390 likes | 501 Views
Adrian Slade Principal Pattern Engineer aslade@synon.com. Pattern Libraries: Theory. Agenda. What is a Pattern? Why Patterns now? Library structure Naming & Coding conventions Using the Patterns OBASE integration & future Questions Quick demo. What’s a Pattern?.
E N D
Adrian Slade Principal Pattern Engineer aslade@synon.com Pattern Libraries:Theory
Agenda • What is a Pattern? • Why Patterns now? • Library structure • Naming & Coding conventions • Using the Patterns • OBASE integration & future • Questions • Quick demo
What’s a Pattern? • Describes a solution to a problem within a context • Obsydian stores and codifies reusable patterns • 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
Example 1 Function to load a grid
Example 2 Simple Business Contact
What’s New? • Collections Points • Enable merge of code • Multiple Function Inheritance • Code comes from several sources • Will be enabled in Obsydian V3.5
Multiple Function Inheritance Function A (part 1) Function B Function A (part 2) Function C (part 1) Function A (part 3) Function C (part 2) Local code Function A Function B Function C Multiple is a triples Code merges
What’s New? • Collections Points • Enable merge of code • Multiple Function Inheritance • Code comes from several sources • Will be enabled in Obsydian V3.5 • ActiveX enabled on Panels • Allows better runtime control of the panel
What’s New? • Collections Points • Enable merge of code • Multiple Function Inheritance • Code comes from several sources • Will be enabled in Obsydian V3.5 • ActiveX enabled on Panels • Allows better runtime control of the panel • Extract All • No sub models required. All libraries at once.
Structure • Library content is more discrete • Easier to find objects • Models are smaller • Smaller pieces • Easier to replace parts of a composite pattern • Not all Synon originated
Layers Vertical Applications Retail banking, Insurance … Horizontal Applications Inventory, A/R, A/P, GL ... Business Support Workflow, Security, Archiving, Transaction Processing Foundations Data maintenance, different GUI styles ... AdLibs Storage, Validate Active, UIStyle ...
Structure Diagram ACTIVE UIBASIC AS400 ODBC3 DATE WINAPI STORAGE VALIDATE ... FOUNDATION Technology Libraries UISTYLE FIELDS OBJECTS A model’s libraries are on the line below it
OBJECTS • The current library but modified • Function shell as top of inheritance tree • Provides message services • UI function shell • Defines the common Events Handler • Some more ‘*’ fields
FIELDS • Common field definitions • Reduces field redundancy and name clashes • Exceptions : ‘*’ fields
STORAGE • An entity with views - Update & Fetch • Update view scopes 4 functions • Insert, Update & Delete row • CheckedUpdate - image compare • Fetch view scopes 4 functions • CheckRow • FetchRow Get one instance • BlockFetch Get sequential • ProcessGroup Process some instances • Type specific entities • RelationalTable • …
VALIDATE • Meta functions for validation
ACTIVE • Wrapper functions to handle common ActiveX controls • Calendar • Treeview/Listview • Progress bar • File Open/Save • … • Scripts and code included to make them work • Most from Microsoft • Part of Windows O/S
UIBASIC • Granular unscoped functions • Functions with panel elements • Display, Update, Grid • Combined in some useful ways • Update with New • Some code to handle control states • protect keys, • protect virtuals, • …
UISTYLE • Replacement for ‘Standard functions’, plus • More complex combinations of UIBASIC functions • Dual grids • Grid with editing region • … • Includes validation
FOUNDATION • Several useful Entities • EditDetail Grid maintained entity • EditDialog User maintained entity • SurrogateKeyed Enumerated entity • SurrogateAlternate - New • ReferredTo Referenced entity • Association Two parent child (3 flavors) • … • Provides a starter set for new developers • ‘How-To Guide’ for pattern developers
Technology Libraries • AS400 • AS/400 specific functionality • No entities • DATE • Same as the current OBDATE • ODBC3 • ODBC version 3 compliant API’s • Rewritten and much smaller • WINAPI • Windows API’s for 32 bit applications • Combination of the current OBWIN, OBNT and OBMAPI
Naming Conventions • Most names have no spaces • EditDetail • Name clashes avoided • Exception - STORAGE/RelationalTable.Physical table • Panel regions and local variables
Naming Conventions • Most names have no spaces • EditDetail • Name clashes avoided • Exception - STORAGE/Physical Table • Panel regions and Local variables • ActiveX Scripts
Coding Conventions • Most code added in subroutines or collection points • Most subroutines have a start and end edit point • Code is also conditioned on a meta field
Coding Conventions • Most code added in subroutines or collection points • Most subroutines have a start and end edit point • Code is also conditioned on a meta field • Local fields added to function specific variables
ActiveX Scripts • Scoped to function • Allows local modification • All in VB Script • Provide support for the control’s events
How do I use all this? • Build larger functions from smaller parts in (almost) any combination • Add in parts later as required • Add an is a to your function • Set values and call subroutines to use the inherited code • Can all be described in the documentation - compiled HTML
Compiled HTML Pattern Library Help File
OBASE integration OBJECTS OBASE… Patterns An Application • Entities can be a mixture of inheritance • Application can be a mixture of old and new • Integration across function partition • Old functions cannot inherit from new ones
OBASE futures • OBASE key element of a 5250 solution • Will keep up-to-date with the product • Will support any new generators • No major enhancements or new entities
Model statistics • 10 entities - 10 tables, 26 views, 53 fields, 1024 triples • 116 implemented functions, 25 with panels • 11 functions have AD changes - 188 lines of code • 21 panels with design changes • Local model - 2.45mb, group model 634kb • Generates 220,000 lines of code in 2min 20sec • 6.93mb source in 500 files • Takes 11min to compile for release • 3.17mb application in 155 files • Average DLL size is 22kb, largest is 69kb
Adrian Slade Principal Pattern Engineer aslade@synon.com Pattern Libraries:Theory