ENTERPRISE APPLICATION DESIGN PATTERNS IMPROVED AND APPLIED Stuart





































- Slides: 37
ENTERPRISE APPLICATION DESIGN PATTERNS: IMPROVED AND APPLIED Stuart Thiel sthiel@cs. concordia. ca February 11, 2010 Department of Computer Science and Software Engineering Concordia University
Outline Enterprise Application Design Patterns: Improved and Applied Outline A Brief Overview of Development Problems for Software Engineers A Progression Through Fowler’s Patterns Domain Objects and Improved Patterns Applying Patterns with the Soen. EA Framework February 2010 Stuart Thiel 2
Developers Work With Software Enterprise Application Design Patterns: Improved and Applied Developers Work With Software • Design • Implement • Test • Maintain February 2010 Stuart Thiel 3
Developer Tools Enterprise Application Design Patterns: Improved and Applied Developer Aids/Tools • Programming Languages • Integrated Development Environments • Processes / Artifacts • Patterns / Styles February 2010 Stuart Thiel 4
Problems Enterprise Application Design Patterns: Improved and Applied Problems • Fowler describes architectural patterns, but no overall usage guidelines – High level patterns lack broad examples – Guidance on interrelation of patterns is sparse – Pattern theory / implementation separation ambiguous • Cooking Analogy February 2010 Stuart Thiel 5
P. Few Simple Examples Enterprise Application Design Patterns: Improved and Applied Problems: : Few Simple Examples • Trivial examples for Fowler’s patterns, usually covering only a piece of functionality February 2010 Stuart Thiel 6
P. Interrelation Not Described Enterprise Application Design Patterns: Improved and Applied Problems: : Interrelation Not Described • Not usually covering more than one or two patterns at a time • Discussion of interrelation limited February 2010 Stuart Thiel 7
P. Theory Implementation Enterprise Application Design Patterns: Improved and Applied Problems: : Theory Mixes with Implementation, or is Kept Apart • Lazy Load • Unit of Work February 2010 Stuart Thiel 8
Problem Summary Enterprise Application Design Patterns: Improved and Applied Problems Summary • The components of a solution are available • We can readily identify patterns in existing software • There is no description of what to do February 2010 Stuart Thiel 9
Solutions Enterprise Application Design Patterns: Improved and Applied Solutions Review of Existing Patterns An Additional Patterns Refined Patterns Soen. EA February 2010 Stuart Thiel 10
Existing Patterns Enterprise Application Design Patterns: Improved and Applied Review of Existing Patterns Fowler identifies important patterns They need context wrt each other Transaction Script to complex Domain Model February 2010 Stuart Thiel 11
Additional Patterns Enterprise Application Design Patterns: Improved and Applied Additional Pattern Domain Object Front Command Dispatcher List Proxy February 2010 Stuart Thiel 12
Refined Patterns: : Mappers Enterprise Application Design Patterns: Improved and Applied Refined Patterns Data Mapper / Table Data Gateway v. Input Mapper v. Output Mapper v. Table Data Gateway v. Finder February 2010 Stuart Thiel 13
Refined Patterns: : Others Enterprise Application Design Patterns: Improved and Applied Refined Patterns Front Controller Lazy Load Identity Map Unit of Work February 2010 Stuart Thiel 14
Soen. EA: : advantages Enterprise Application Design Patterns: Improved and Applied Soen. EA help eliminate tedious tasks, help programmers to make fewer mistakes, and give guidance on proper practices. February 2010 Stuart Thiel 15
Soen. EA: : provides Enterprise Application Design Patterns: Improved and Applied Soen. EA Patterns Utility components Default Implementations of Typical Components (DITCs) Test components February 2010 Stuart Thiel 16
Summary Enterprise Application Design Patterns: Improved and Applied Soen. EA Summary • Developers can use our contribution to build on their understanding of existing patterns • They can use Soen. EA to quickly develop software • Soen. EA is like a jigsaw puzzle February 2010 Stuart Thiel 17
Conclusion Enterprise Application Design Patterns: Improved and Applied Conclusion • We have brought together a lot of other people’s good ideas • Our approach has been used in commercial applications • Our approach has allowed consistent and reliable development • Our approach is readily communicable February 2010 Stuart Thiel 18
Future Work Enterprise Application Design Patterns: Improved and Applied Future Work • Code Generation • Testing • Application Level Patterns • Validator Pattern • Refining Data Gateway Implementations • Integration with other artefacts 0 February 2010 Stuart Thiel 19
Thank You Enterprise Application Design Patterns: Improved and Applied Thank You! 20
Enterprise Application Design Patterns: Improved and Applied 21
Enterprise Application Design Patterns: Improved and Applied 22
Enterprise Application Design Patterns: Improved and Applied 23
An Analogy Enterprise Application Design Patterns: Improved and Applied An Analogy • Software Development -> Cooking • WEA Development -> Baking February 2010 Stuart Thiel 24
An Analogy: : Styles Enterprise Application Design Patterns: Improved and Applied An Analogy: : Styles • Layered Style, Event-based Style, Process Control, Blackboard • Cakes/Pizza, Cookies/Muffins, Souflé, Omlette/Pancake February 2010 Stuart Thiel 25
An Analogy: : Design Patterns Enterprise Application Design Patterns: Improved and Applied An Analogy: : Design Patterns • Command, Factory, Adapter, Proxy • Mixing, Chopping, Heating, Greasing, Measuring February 2010 Stuart Thiel 26
An Analogy: : Architectural Patterns Enterprise Application Design Patterns: Improved and Applied An Analogy: : Architectural Patterns • Lazy Load, Pessimistic Offline Lock , Unit Of Work • Mixing Dry Ingredients vs. Wet, Checking That All Ingredients Are Available Before Starting, Preparing All Ingredients February 2010 Stuart Thiel 27
Analogy: : Frameworks Enterprise Application Design Patterns: Improved and Applied An Analogy: : Frameworks • Struts 1. 0 - > Waffle Iron • Hibernate -> Bread Maker February 2010 Stuart Thiel 28
Enterprise Application Design Patterns: Improved and Applied 29
Enterprise Application Design Patterns: Improved and Applied 30
Enterprise Application Design Patterns: Improved and Applied 31
Cyclic Reference Solution Enterprise Application Design Patterns: Improved and Applied Cyclic Reference • Where to solve it? – Input Mapper • Common Alternatives – Loading other Domain Objects after February 2010 Stuart Thiel 32
Enterprise Application Design Patterns: Improved and Applied Cyclic Reference alternative Easy: February 2010 Stuart Thiel 33
Enterprise Application Design Patterns: Improved and Applied public Person find(long id) { //Check Identity Map and return if found if(Identity. Map. has(id, Person. class)) return Identity. Map. get(id, Person. class); //Not in Identity Map Result. Set rs = Person. Finder. find(id); if(!rs. next) ; // Person p = new Person(id); Uo. W. get. Current. register. Clean(p); Person buddy = find(rs. get. Long("buddy")); p. set. Buddy(buddy); } February 2010 Stuart Thiel 34
Enterprise Application Design Patterns: Improved and Applied Cyclic Reference alternative Harder February 2010 Stuart Thiel 35
Enterprise Application Design Patterns: Improved and Applied public Person find(long id) { //Check Identity Map and return if found if(Identity. Map. has(id, Person. class)) return Identity. Map. get(id, Person. class); //Not in Identity Map Result. Set rs = Person. Finder. find(id); if(!rs. next) ; // Person p = new Person(id); Uo. W. get. Current. register. Clean(p); Pet pet = find(rs. get. Long("pet")); p. set. Pet(pet); } February 2010 Stuart Thiel 36
Enterprise Application Design Patterns: Improved and Applied Proxy public Person find(long id) { //Check Identity Map and return if found if(Identity. Map. has(id, Person. class)) return Identity. Map. get(id, Person. class); //Not in Identity Map Result. Set rs = Person. Finder. find(id); if(!rs. next) ; // Person p = new Person(id, new Person. Proxy(rs. get. Long("buddy"))); Uo. W. get. Current. register. Clean(p); } February 2010 Stuart Thiel 37