Pattern Libraries:
TheoryAdrian SladePrincipal Pattern [email protected]
©1998 Synon Corporation©1998 Synon Corporation 2
AgendaAgenda
What is a Pattern?What is a Pattern? Why Patterns now?Why Patterns now? Library structureLibrary structure Naming & Coding conventionsNaming & Coding conventions Using the PatternsUsing the Patterns OBASE integration & futureOBASE integration & future QuestionsQuestions Quick demoQuick demo
©1998 Synon Corporation©1998 Synon Corporation 3
What’s a Pattern?What’s a Pattern?
Describes a solution to a problem within a contextDescribes a solution to a problem within a context Obsydian stores and codifies reusable patternsObsydian stores and codifies reusable patterns Class libraries are now Pattern LibrariesClass libraries are now Pattern Libraries
Analysis Patterns by Fowler. Pub: Addison-Wesley. ISBN 0-201-89542-0Analysis Patterns by Fowler. Pub: Addison-Wesley. ISBN 0-201-89542-0Pattern Oriented Software Architecture by Buschmann, Meunier, Rohnert, Sommerland Pattern Oriented Software Architecture by Buschmann, Meunier, Rohnert, Sommerland
& Stall. Pub: Wiley. ISBN 0-471-95869-7& Stall. Pub: Wiley. ISBN 0-471-95869-7
©1998 Synon Corporation©1998 Synon Corporation 4
Example 1Example 1
Function to load a grid
©1998 Synon Corporation©1998 Synon Corporation 5
Example 2Example 2
Simple Business ContactSimple Business Contact
©1998 Synon Corporation©1998 Synon Corporation 6
What’s New?What’s New?
Collections PointsCollections Points Enable merge of codeEnable merge of code
Multiple Function InheritanceMultiple Function Inheritance Code comes from several sourcesCode comes from several sources Will be enabled in Obsydian V3.5Will be enabled in Obsydian V3.5
©1998 Synon Corporation©1998 Synon Corporation 7
Multiple Function InheritanceMultiple Function Inheritance
Function CFunction BFunction A
Function A (part 1)
Function A (part 2)
Function B
Function C (part 1)
Function C (part 2)
Function A (part 3)
Local code
Multiple is ais a triples
Code merges
©1998 Synon Corporation©1998 Synon Corporation 8
What’s New?What’s New?
Collections PointsCollections Points Enable merge of codeEnable merge of code
Multiple Function InheritanceMultiple Function Inheritance Code comes from several sourcesCode comes from several sources Will be enabled in Obsydian V3.5Will be enabled in Obsydian V3.5
ActiveX enabled on PanelsActiveX enabled on Panels Allows better runtime control of the panelAllows better runtime control of the panel
©1998 Synon Corporation©1998 Synon Corporation 9
What’s New?What’s New?
Collections PointsCollections Points Enable merge of codeEnable merge of code
Multiple Function InheritanceMultiple Function Inheritance Code comes from several sourcesCode comes from several sources Will be enabled in Obsydian V3.5Will be enabled in Obsydian V3.5
ActiveX enabled on PanelsActiveX enabled on Panels Allows better runtime control of the panelAllows better runtime control of the panel
Extract AllExtract All No sub models required. All libraries at once.No sub models required. All libraries at once.
©1998 Synon Corporation©1998 Synon Corporation 10
StructureStructure
Library content is more discreteLibrary content is more discrete Easier to find objectsEasier to find objects Models are smallerModels are smaller
Smaller piecesSmaller pieces Easier to replace parts of a composite patternEasier to replace parts of a composite pattern
Not all Synon originatedNot all Synon originated
©1998 Synon Corporation©1998 Synon Corporation 11
LayersLayers
Horizontal ApplicationsHorizontal Applications Inventory,A/R, A/P, GL ...
Vertical ApplicationsVertical Applications Retail banking,Insurance …
Business SupportBusiness Support Workflow, Security, Archiving, Transaction Processing
FoundationsFoundationsData maintenance,
different GUI styles ...
AdLibsAdLibs Storage, Validate Active, UIStyle ...
©1998 Synon Corporation©1998 Synon Corporation 12
Structure DiagramStructure Diagram
OBJECTS
ACTIVE UIBASIC
STORAGE VALIDATE
UISTYLE
FIELDS
A model’s libraries are on the line below it
FOUNDATIONTechnology Libraries
WINAPI
AS400 ODBC3 DATE
...
©1998 Synon Corporation©1998 Synon Corporation 13
OBJECTSOBJECTS
The current library but modifiedThe current library but modified Function shell as top of inheritance treeFunction shell as top of inheritance tree
Provides message servicesProvides message services UI function shellUI function shell
Defines the common Events HandlerDefines the common Events Handler Some more ‘*’ fieldsSome more ‘*’ fields
©1998 Synon Corporation©1998 Synon Corporation 14
FIELDSFIELDS
Common field definitionsCommon field definitions Reduces field redundancy and name clashesReduces field redundancy and name clashes
Exceptions : ‘*’ fieldsExceptions : ‘*’ fields
©1998 Synon Corporation©1998 Synon Corporation 15
STORAGESTORAGE
An entity with views - Update & FetchAn entity with views - Update & Fetch Update view scopes 4 functionsUpdate view scopes 4 functions
• Insert, Update & Delete rowInsert, Update & Delete row• CheckedUpdate - image compareCheckedUpdate - image compare
Fetch view scopes 4 functionsFetch view scopes 4 functions• CheckRowCheckRow• FetchRow FetchRow Get one instance Get one instance• BlockFetch BlockFetch Get sequential Get sequential• ProcessGroup ProcessGroup Process some instances Process some instances
Type specific entitiesType specific entities• RelationalTableRelationalTable• ……
©1998 Synon Corporation©1998 Synon Corporation 16
VALIDATEVALIDATE
Meta functions for validationMeta functions for validation
©1998 Synon Corporation©1998 Synon Corporation 17
ACTIVEACTIVE
Wrapper functions to handle common ActiveX Wrapper functions to handle common ActiveX controlscontrols CalendarCalendar Treeview/ListviewTreeview/Listview Progress barProgress bar File Open/SaveFile Open/Save ……
Scripts and code included to make them workScripts and code included to make them work Most from MicrosoftMost from Microsoft
Part of Windows O/SPart of Windows O/S
©1998 Synon Corporation©1998 Synon Corporation 18
UIBASICUIBASIC
Granular unscoped functionsGranular unscoped functions Functions with panel elementsFunctions with panel elements
Display, Update, GridDisplay, Update, Grid Combined in some useful waysCombined in some useful ways
Update with NewUpdate with New Some code to handle control statesSome code to handle control states
protect keys, protect keys, protect virtuals, protect virtuals, ……
©1998 Synon Corporation©1998 Synon Corporation 19
UISTYLEUISTYLE
Replacement for ‘Standard functions’, plusReplacement for ‘Standard functions’, plus More complex combinations of UIBASIC functionsMore complex combinations of UIBASIC functions
Dual gridsDual grids Grid with editing regionGrid with editing region ……
Includes validationIncludes validation
©1998 Synon Corporation©1998 Synon Corporation 20
FOUNDATIONFOUNDATION
Several useful EntitiesSeveral useful Entities EditDetail EditDetail Grid maintained entity Grid maintained entity EditDialog EditDialog User maintained entity User maintained entity SurrogateKeyed SurrogateKeyed Enumerated entity Enumerated entity SurrogateAlternate - NewSurrogateAlternate - New ReferredTo ReferredTo Referenced entity Referenced entity Association Association Two parent child (3 flavors) Two parent child (3 flavors) ……
Provides a starter set for new developersProvides a starter set for new developers ‘‘How-To Guide’ for pattern developersHow-To Guide’ for pattern developers
©1998 Synon Corporation©1998 Synon Corporation 21
Technology LibrariesTechnology Libraries AS400AS400
AS/400 specific functionalityAS/400 specific functionality No entitiesNo entities
DATEDATE Same as the current OBDATESame as the current OBDATE
ODBC3ODBC3 ODBC version 3 compliant API’sODBC version 3 compliant API’s Rewritten and much smallerRewritten and much smaller
WINAPIWINAPI Windows API’s for 32 bit applicationsWindows API’s for 32 bit applications Combination of the current OBWIN, OBNT and OBMAPICombination of the current OBWIN, OBNT and OBMAPI
©1998 Synon Corporation©1998 Synon Corporation 22
Naming ConventionsNaming Conventions
Most names have no spacesMost names have no spaces EditDetailEditDetail
Name clashes avoidedName clashes avoided Exception - STORAGE/RelationalTable.Physical tableException - STORAGE/RelationalTable.Physical table
Panel regions and local variablesPanel regions and local variables
©1998 Synon Corporation©1998 Synon Corporation 23
Panel & Local VariablesPanel & Local Variables
©1998 Synon Corporation©1998 Synon Corporation 24
Naming ConventionsNaming Conventions
Most names have no spacesMost names have no spaces EditDetailEditDetail
Name clashes avoidedName clashes avoided Exception - STORAGE/Physical TableException - STORAGE/Physical Table
Panel regions and Local variablesPanel regions and Local variables ActiveX ScriptsActiveX Scripts
©1998 Synon Corporation©1998 Synon Corporation 25
ActiveX ScriptsActiveX Scripts
©1998 Synon Corporation©1998 Synon Corporation 26
Coding ConventionsCoding Conventions
Most code added in subroutines or collection Most code added in subroutines or collection pointspoints
Most subroutines have a start and end edit pointMost subroutines have a start and end edit point Code is also conditioned on a meta fieldCode is also conditioned on a meta field
©1998 Synon Corporation©1998 Synon Corporation 27
Subroutines & Collection PointsSubroutines & Collection Points
©1998 Synon Corporation©1998 Synon Corporation 28
Coding ConventionsCoding Conventions
Most code added in subroutines or collection Most code added in subroutines or collection pointspoints
Most subroutines have a start and end edit pointMost subroutines have a start and end edit point Code is also conditioned on a meta fieldCode is also conditioned on a meta field
Local fields added to function specific variablesLocal fields added to function specific variables
©1998 Synon Corporation©1998 Synon Corporation 29
Local variablesLocal variables
©1998 Synon Corporation©1998 Synon Corporation 30
ActiveX ScriptsActiveX Scripts
Scoped to functionScoped to function Allows local modificationAllows local modification
All in VB ScriptAll in VB Script Provide support for the control’s eventsProvide support for the control’s events
©1998 Synon Corporation©1998 Synon Corporation 31
VB ScriptVB Script
©1998 Synon Corporation©1998 Synon Corporation 32
How do I use all this?How do I use all this?
Build larger functions from smaller parts in (almost) Build larger functions from smaller parts in (almost) any combinationany combination Add in parts later as requiredAdd in parts later as required
Add an Add an is ais a to your function to your function Set values and call subroutines to use the inherited Set values and call subroutines to use the inherited
codecode Can all be described in the documentation - Can all be described in the documentation -
compiled HTMLcompiled HTML
©1998 Synon Corporation©1998 Synon Corporation 33
Compiled HTMLCompiled HTML
Compiled HTML filePattern Library Help File
©1998 Synon Corporation©1998 Synon Corporation 34
OBASE integrationOBASE integration
Entities can be a mixture of inheritanceEntities can be a mixture of inheritance Application can be a mixture of old and newApplication can be a mixture of old and new Integration across function partitionIntegration across function partition Old functions cannot inherit from new onesOld functions cannot inherit from new ones
OBASE… Patterns
An Application
OBJECTS
©1998 Synon Corporation©1998 Synon Corporation 35
OBASE futuresOBASE futures
OBASE key element of a 5250 solutionOBASE key element of a 5250 solution Will keep up-to-date with the productWill keep up-to-date with the product Will support any new generatorsWill support any new generators No major enhancements or new entitiesNo major enhancements or new entities
©1998 Synon Corporation©1998 Synon Corporation 36
Questions?Questions?
©1998 Synon Corporation©1998 Synon Corporation 37
Model statisticsModel statistics
10 entities - 10 tables, 26 views, 53 fields, 1024 triples10 entities - 10 tables, 26 views, 53 fields, 1024 triples 116 implemented functions, 25 with panels116 implemented functions, 25 with panels 11 functions have AD changes - 188 lines of code11 functions have AD changes - 188 lines of code 21 panels with design changes21 panels with design changes Local model - 2.45mb, group model 634kbLocal model - 2.45mb, group model 634kb Generates 220,000 lines of code in 2min 20secGenerates 220,000 lines of code in 2min 20sec 6.93mb source in 500 files6.93mb source in 500 files Takes 11min to compile for releaseTakes 11min to compile for release 3.17mb application in 155 files3.17mb application in 155 files Average DLL size is 22kb, largest is 69kbAverage DLL size is 22kb, largest is 69kb
©1998 Synon Corporation©1998 Synon Corporation 38
Patterns in ActionPatterns in Action
Pattern Libraries:
TheoryAdrian SladePrincipal Pattern [email protected]