1 / 50

VBUG Talks in Bristol http://cms.vbug.net

VBUG Talks in Bristol http://cms.vbug.net. Coordinators David Ringsell david@talk-it.biz www.talk-it.biz Steve Hallam steve@plumsoft.co.uk. Talks in Bristol. Ain’t No Mountain High Enough .Net Case Study Matt Link Wednesday February 15th What?!? C# Could Do That???

kevork
Download Presentation

VBUG Talks in Bristol http://cms.vbug.net

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. VBUG Talks in Bristolhttp://cms.vbug.net Coordinators David Ringsell david@talk-it.biz www.talk-it.biz Steve Hallam steve@plumsoft.co.uk

  2. Talks in Bristol Ain’t No Mountain High Enough .Net Case Study Matt Link Wednesday February 15th • What?!? C# Could Do That??? Shay Friedman Tuesday March 27th

  3. Matt Link Ain’t No Mountain High Enough - a product case study

  4. Covering…….. • Challenges in writing a product vs. bespoke • Customisations • Version Control • Deployment • Security

  5. What is Parnassus? • A mountain of limestone in central Greece 

  6. What is Parnassus?

  7. What is Parnassus? Awarding Body Management Software

  8. What is Parnassus? To Parnassus…..

  9. Challenges in writing a product • Versioning & Deployment • Many installations, not all upgraded at the same time • Integrations • Many require integration with other systems • Customisations • UI • Business Logic • Security

  10. Challenges in writing a product • How to handle these issues whilst: • Keeping the code maintainable • One code base • Ensure changes for one customer don’t adversely affect another customer

  11. Customisations

  12. Plug-ins • Improved Maintainability of code • Customer Specific code doesn’t end up in core Parnassus • Fewer settings • Easier to test • Additional code is self-contained in the Plug-in • Greater Flexibility • Not all code changes now require a new version of Parnassus to be created

  13. MEF (Managed Extensibility Framework) • A bit like

  14. MEF

  15. MEF • A Composable Part is something which either • Needs (Imports) something • Offers (Exports) something • Both! These “needs” and “offers” are matched based on Contracts by a Container We use Interfaces, but you can just use a string……..

  16. MEF (Managed Extensibility Framework)

  17. MEF A Part Specifies what it wants to Import [ImportMany(typeof(IQualificationRegistrationCreated))] A Part specifies what it can Export [Export(typeof(IQualificationRegistrationCreated))] The Container matches the two together A Catalogue is used to discover the Parts

  18. MEF public static CompositionContainerContainer { get { string dir = PluginDirectory; DirectoryCatalogcat = new DirectoryCatalog(dir); varcontainer = new CompositionContainer(cat); return container; } } DirectoryCatalog scans a given directory for Parts public static void Compose(object toCompose) { try { CompositionContainerc = Container; c.ComposeParts(toCompose); } catch (Exception ex1) { throw new Exception("Error Composing Object: " +toCompose.GetType().Name,ex1); } } Calling “ComposeParts” on a Container matches Imports to Exports

  19. MEF - A Quick demo ImportedPlugins Class [ImportMany(typeof(IQualificationRegistrationCreated))] public FilteredExportCollection<IQualificationRegistrationCreated> QualificationRegistrationCreated { get; internal set; } Contract FilteredExportCollection<T> : ICollection QualificationRegistrationCreated_Demo Class [Export(typeof(IQualificationRegistrationCreated))] public class QualificationRegistrationCreated_Demo: IQualificationRegistrationCreated

  20. MEF - A Quick Demo • To the Code………..

  21. MEF When the Compose Method is called on the Container, MEF matches Imports to Exports based on the Contracts. This populates a collection (in our case a generic FilteredExportCollection<T>) Any Exports matching the Contract are now available in the collection

  22. MEF – Example Uses • Custom Validation • Normally involves • Yet another setting / Code into core Parnassus • Finance • Address Lookup • Integration • E.g. On learner save send details to another system

  23. Translations • Every customer calls things by different names • Translations needs to be applied everywhere with minimum of developer effort • Every customer has a different set of translations

  24. Translations • Extension Method • “Add" methods to existing types • Enables you to do:

  25. Translations

  26. Translations • On every page: • For each Control on the page… • Get Control Type • Change a property to the translated version…

  27. Security • Similar challenge with security • Every customer has different rules • asp.net Page level security not fine grained enough Only controls access to whole pages / folders • Field level security required • Minimise developer effort (make security easy)

  28. Security

  29. Security • Gets cached security rules for the page • For each Control on the page… • Get Control Type • Apply security rules based on control type • E.g. GridView - Adds an Event Handler to DataBound event

  30. Security • Parnassus as a Centre User…. • Limited menu options • Restricted to seeing limited details of own centre • Restricted to viewing only their learners • Customer decides how much each User / Role can see and do in Parnassus • To Parnassus…… • User: Centre1 • Pass: Centre1

  31. Deployment

  32. Deployment • Many customers, many versions • About 4 different versions being supported • Initially struggled with upgrade paths • DB change scripts from one specific version  another specific version Feb December Customer A - Jan April December Customer B - Jan

  33. Deployment • Problems: • Almost no reuse of upgrade scripts • Customer A’s V3.0 not quite the same as Customer B’s • OK when fairly regular updates, harder when big jumps

  34. Deployment Solution = Database Projects • No more schema upgrade scripts • Will upgrade any version of Parnassus • Quicker than producing upgrade scripts • Potential to use them for Source Control of the Database

  35. SQL Deployment – Database Projects Visual Studio • 1) Database Synced with Database Project BuildOutput • 2) DB Project produces .dbschema

  36. Deployment • To a quick Parnassus Upgrade…..

  37. Versioning

  38. Versioning – What changed / changing when • Work Items in TFS for us • Assign work to Versions / Iterations • Track work status (Design / Coding / Testing) • Associate code check-in with work items • Change Log comments for the customer • Viewer App to extract them • Quickly generate a change log for a version

  39. TFS Work Items

  40. Branching & Merging • Need to be able to release patch versions • Fix once, apply to all versions • Allow ongoing development at the same time • Requires • Source Control Software (TFS) • Compare / Merge tool (DiffMerge) • A branching strategy…..

  41. Branch Label

  42. Branches are duplications of an object under revision control so that modifications can happen in parallel along both branches.

  43. On going development of new functionality

  44. Branching & Merging • Visual Studio TFS Branching Guide http://vsarbranchingguide.codeplex.com/

  45. Other things to talk about…. • Custom User Controls • Settings • Code Generation • Auditing

  46. Questions

More Related