Presentation is loading. Please wait.

Presentation is loading. Please wait.

VBUG Talks in Bristol Coordinators David Ringsell Steve Hallam

Similar presentations


Presentation on theme: "VBUG Talks in Bristol Coordinators David Ringsell Steve Hallam"— Presentation transcript:

1 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

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

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

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 Sites Qualifications Offered Centres Pathways Units Qualifications Registrations (Single and bulk upload) Grades (Single and bulk upload) Learners Certificate Printing Export to 3 rd Party printing software Certification 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 eBay Website Buyers Looking for X Sellers Have x

14 MEF eBay Website Buyers Looking for X Sellers Have x MEF Composition Container Imports Looking for X Exports Have x

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 CompositionContainer Container { get { string dir = PluginDirectory; DirectoryCatalog cat = new DirectoryCatalog(dir); var container = new CompositionContainer(cat); return container; } public static void Compose(object toCompose) { try { CompositionContainer c = 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 DirectoryCatalog scans a given directory for Parts

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

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

21 MEF 1.When the Compose Method is called on the Container, MEF matches Imports to Exports based on the Contracts. 2.This populates a collection (in our case a generic FilteredExportCollection ) 3.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  On every page:  For each Control on the page… 1. Get Control Type 2. 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  Gets cached security rules for the page  For each Control on the page… 1. Get Control Type 2. Apply security rules based on control type 1. 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  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 Customer A - Jan FebDecember Customer B - Jan AprilDecember

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  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 Solution = Database Projects

35 Deployment – Database Projects Visual StudioSQL 1) Database Synced with Database Project Build Output 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 BranchLabel

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

45

46

47

48 Branching & Merging  Visual Studio TFS Branching Guide http://vsarbranchingguide.codeplex.com/

49 Other things to talk about….  Custom User Controls  Settings  Code Generation  Auditing

50 Questions


Download ppt "VBUG Talks in Bristol Coordinators David Ringsell Steve Hallam"

Similar presentations


Ads by Google