Pattern Libraries Theory l Adrian Slade l Principal
Pattern Libraries: Theory l Adrian Slade l Principal Pattern Engineer l aslade@synon. com
Agenda l What is a Pattern? l Why Patterns now? l Library structure l Naming & Coding conventions l Using the Patterns l OBASE integration & future l Questions l Quick demo © 1998 Synon Corporation 2
What’s a Pattern? l Describes a solution to a problem within a context l Obsydian stores and codifies reusable patterns l Class libraries are now Pattern Libraries Analysis Patterns by Fowler. Pub: Addison-Wesley. ISBN 0 -201 -89542 -0 Pattern Oriented Software Architecture by Buschmann, Meunier, Rohnert, Sommerland & Stall. Pub: Wiley. ISBN 0 -471 -95869 -7 © 1998 Synon Corporation 3
Example 1 Function to load a grid © 1998 Synon Corporation 4
Example 2 Simple Business Contact © 1998 Synon Corporation 5
What’s New? l Collections Points n l Enable merge of code Multiple Function Inheritance n Code comes from several sources n Will be enabled in Obsydian V 3. 5 © 1998 Synon Corporation 6
Multiple Function Inheritance Function A Function B Function C Multiple is a triples Function A (part 1) Function B Code merges Function A (part 2) Function C (part 1) Function A (part 3) Function C (part 2) Local code © 1998 Synon Corporation 7
What’s New? l Collections Points n l l Enable merge of code Multiple Function Inheritance n Code comes from several sources n Will be enabled in Obsydian V 3. 5 Active. X enabled on Panels n © 1998 Synon Corporation Allows better runtime control of the panel 8
What’s New? l Collections Points n l l Multiple Function Inheritance n Code comes from several sources n Will be enabled in Obsydian V 3. 5 Active. X enabled on Panels n l Enable merge of code Allows better runtime control of the panel Extract All n © 1998 Synon Corporation No sub models required. All libraries at once. 9
Structure l l Library content is more discrete n Easier to find objects n Models are smaller Smaller pieces n l Easier to replace parts of a composite pattern Not all Synon originated © 1998 Synon Corporation 10
Layers Vertical Applications Retail banking, Insurance … Horizontal Applications Inventory, A/R, A/P, GL. . . Business Support Foundations Ad. Libs © 1998 Synon Corporation Workflow, Security, Archiving, Transaction Processing Data maintenance, different GUI styles. . . Storage, Validate Active, UIStyle. . . 11
Structure Diagram FOUNDATION Technology Libraries UISTYLE ACTIVE UIBASIC AS 400 STORAGE VALIDATE WINAPI ODBC 3 DATE . . . FIELDS OBJECTS A model’s libraries are on the line below it © 1998 Synon Corporation 12
OBJECTS l The current library but modified l Function shell as top of inheritance tree n l UI function shell n l Provides message services Defines the common Events Handler Some more ‘*’ fields © 1998 Synon Corporation 13
FIELDS l Common field definitions n l Reduces field redundancy and name clashes Exceptions : ‘*’ fields © 1998 Synon Corporation 14
STORAGE l An entity with views - Update & Fetch n Update view scopes 4 functions • Insert, Update & Delete row • Checked. Update - image compare n Fetch view scopes 4 functions • Check. Row • Fetch. Row Get one instance • Block. Fetch Get sequential • Process. Group Process some instances l Type specific entities • Relational. Table • … © 1998 Synon Corporation 15
VALIDATE l Meta functions for validation © 1998 Synon Corporation 16
ACTIVE l Wrapper functions to handle common Active. X controls n Calendar n Treeview/Listview n Progress bar n File Open/Save n … l Scripts and code included to make them work l Most from Microsoft n © 1998 Synon Corporation Part of Windows O/S 17
UIBASIC l Granular unscoped functions l Functions with panel elements n l Combined in some useful ways n l Display, Update, Grid Update with New Some code to handle control states n protect keys, n protect virtuals, n … © 1998 Synon Corporation 18
UISTYLE l Replacement for ‘Standard functions’, plus l More complex combinations of UIBASIC functions l n Dual grids n Grid with editing region n … Includes validation © 1998 Synon Corporation 19
FOUNDATION l Several useful Entities n Edit. Detail Grid maintained entity n Edit. Dialog User maintained entity n Surrogate. Keyed Enumerated entity n Surrogate. Alternate - New n Referred. To Referenced entity n Association Two parent child (3 flavors) n … l Provides a starter set for new developers l ‘How-To Guide’ for pattern developers © 1998 Synon Corporation 20
Technology Libraries l l AS 400 n AS/400 specific functionality n No entities DATE n l l Same as the current OBDATE ODBC 3 n ODBC version 3 compliant API’s n Rewritten and much smaller WINAPI n Windows API’s for 32 bit applications n Combination of the current OBWIN, OBNT and OBMAPI © 1998 Synon Corporation 21
Naming Conventions l Most names have no spaces n l Name clashes avoided n l Edit. Detail Exception - STORAGE/Relational. Table. Physical table Panel regions and local variables © 1998 Synon Corporation 22
Panel & Local Variables © 1998 Synon Corporation 23
Naming Conventions l Most names have no spaces n l Edit. Detail Name clashes avoided n Exception - STORAGE/Physical Table l Panel regions and Local variables l Active. X Scripts © 1998 Synon Corporation 24
Active. X Scripts © 1998 Synon Corporation 25
Coding Conventions l Most code added in subroutines or collection points l Most subroutines have a start and edit point n © 1998 Synon Corporation Code is also conditioned on a meta field 26
Subroutines & Collection Points © 1998 Synon Corporation 27
Coding Conventions l Most code added in subroutines or collection points l Most subroutines have a start and edit point n l Code is also conditioned on a meta field Local fields added to function specific variables © 1998 Synon Corporation 28
Local variables © 1998 Synon Corporation 29
Active. X Scripts l Scoped to function n Allows local modification l All in VB Script l Provide support for the control’s events © 1998 Synon Corporation 30
VB Script © 1998 Synon Corporation 31
How do I use all this? l Build larger functions from smaller parts in (almost) any combination n Add in parts later as required l Add an is a to your function l Set values and call subroutines to use the inherited code l Can all be described in the documentation compiled HTML © 1998 Synon Corporation 32
Compiled HTML Pattern Library Help File © 1998 Synon Corporation 33
OBASE integration l Entities can be a mixture of inheritance l Application can be a mixture of old and new l Integration across function partition l Old functions cannot inherit from new ones OBJECTS OBASE… Patterns An Application © 1998 Synon Corporation 34
OBASE futures l OBASE key element of a 5250 solution l Will keep up-to-date with the product l Will support any new generators l No major enhancements or new entities © 1998 Synon Corporation 35
Questions? © 1998 Synon Corporation 36
Model statistics l 10 entities - 10 tables, 26 views, 53 fields, 1024 triples l 116 implemented functions, 25 with panels l 11 functions have AD changes - 188 lines of code l 21 panels with design changes l Local model - 2. 45 mb, group model 634 kb l Generates 220, 000 lines of code in 2 min 20 sec l 6. 93 mb source in 500 files l Takes 11 min to compile for release l 3. 17 mb application in 155 files l Average DLL size is 22 kb, largest is 69 kb © 1998 Synon Corporation 37
Patterns in Action © 1998 Synon Corporation 38
Pattern Libraries: Theory l Adrian Slade l Principal Pattern Engineer l aslade@synon. com
- Slides: 39