enterprise application design patterns: improved and applied
DESCRIPTION
Enterprise Application Design Patterns: Improved and Applied. Stuart Thiel [email protected]. February 11, 2010. Outline. Outline A Brief Overview of Development Problems for Software Engineers A Progression Through Fowler’s Patterns Domain Objects and Improved Patterns - PowerPoint PPT PresentationTRANSCRIPT
Department of Computer Science and Software
EngineeringConcordia University
ENTERPRISE APPLICATION DESIGN PATTERNS:IMPROVED AND APPLIED
Stuart [email protected]
February 11, 2010
2
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 SoenEA
Framework
February 2010 Stuart Thiel
Outline
3
Enterprise Application Design Patterns: Improved and Applied
Developers Work With SoftwareDesign
Implement
Test
Maintain
February 2010 Stuart Thiel
Developers Work With Software
4
Enterprise Application Design Patterns: Improved and Applied
Developer Aids/Tools• Programming Languages
• Integrated Development Environments
• Processes / Artifacts
• Patterns / Styles
February 2010 Stuart Thiel
Developer Tools
5
Enterprise Application Design Patterns: Improved and Applied
ProblemsFowler 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
Problems
6
Enterprise Application Design Patterns: Improved and Applied
Problems:: Few Simple ExamplesTrivial examples for Fowler’s patterns, usually
covering only a piece of functionality
February 2010 Stuart Thiel
P. Few Simple Examples
7
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
P. Interrelation Not Described
8
Enterprise Application Design Patterns: Improved and Applied
Problems:: Theory Mixes with
Implementation, or is Kept ApartLazy Load
Unit of Work
February 2010 Stuart Thiel
P. Theory Implementation
9
Enterprise Application Design Patterns: Improved and Applied
Problems SummaryThe 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
Problem Summary
10
Enterprise Application Design Patterns: Improved and AppliedSolutions
Solutions
Review of Existing Patterns
An Additional Patterns
Refined Patterns
SoenEA
February 2010 Stuart Thiel
11
Enterprise Application Design Patterns: Improved and AppliedExisting Patterns
Review of Existing Patterns
Fowler identifies important patterns
They need context wrt each other
Transaction Script to complex Domain Model
February 2010 Stuart Thiel
12
Enterprise Application Design Patterns: Improved and AppliedAdditional Patterns
Additional Pattern
Domain Object
Front Command
Dispatcher
List Proxy
February 2010 Stuart Thiel
13
Enterprise Application Design Patterns: Improved and AppliedRefined Patterns:: Mappers
Refined Patterns
Data Mapper / Table Data GatewayInput MapperOutput MapperTable Data GatewayFinder
February 2010 Stuart Thiel
14
Enterprise Application Design Patterns: Improved and AppliedRefined Patterns:: Others
Refined Patterns
Front Controller
Lazy Load
Identity Map
Unit of Work
February 2010 Stuart Thiel
15
Enterprise Application Design Patterns: Improved and AppliedSoenEA:: advantages
SoenEA
help eliminate tedious tasks,
help programmers to make fewer mistakes, and
give guidance on proper practices.
February 2010 Stuart Thiel
16
Enterprise Application Design Patterns: Improved and AppliedSoenEA:: provides
SoenEA
Patterns
Utility components
Default Implementations of Typical Components (DITCs)
Test components
February 2010 Stuart Thiel
17
Enterprise Application Design Patterns: Improved and Applied
SoenEA Summary• Developers can use our contribution to build on their
understanding of existing patterns• They can use SoenEA to quickly develop software• SoenEA is like a jigsaw puzzle
February 2010 Stuart Thiel
Summary
February 2010 Stuart Thiel
18
Enterprise Application Design Patterns: Improved and Applied
ConclusionWe 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
Conclusion
19
Enterprise Application Design Patterns: Improved and Applied
Future WorkCode Generation
Testing
Application Level Patterns
Validator Pattern
Refining Data Gateway Implementations
Integration with other artefacts0
February 2010 Stuart Thiel
Future Work
20
Enterprise Application Design Patterns: Improved and Applied
Thank You!
Thank You
21
Enterprise Application Design Patterns: Improved and Applied
22
Enterprise Application Design Patterns: Improved and Applied
23
Enterprise Application Design Patterns: Improved and Applied
24
Enterprise Application Design Patterns: Improved and Applied
An AnalogySoftware Development -> Cooking
WEA Development -> Baking
February 2010 Stuart Thiel
An Analogy
25
Enterprise Application Design Patterns: Improved and Applied
An Analogy:: StylesLayered Style, Event-based Style, Process
Control, Blackboard
Cakes/Pizza, Cookies/Muffins, Souflé, Omlette/Pancake
February 2010 Stuart Thiel
An Analogy:: Styles
26
Enterprise Application Design Patterns: Improved and Applied
An Analogy:: Design PatternsCommand, Factory, Adapter, Proxy
Mixing, Chopping, Heating, Greasing, Measuring
February 2010 Stuart Thiel
An Analogy:: Design Patterns
27
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
An Analogy:: Architectural Patterns
28
Enterprise Application Design Patterns: Improved and Applied
An Analogy:: FrameworksStruts 1.0 - > Waffle Iron
Hibernate -> Bread Maker
February 2010 Stuart Thiel
Analogy:: Frameworks
29
Enterprise Application Design Patterns: Improved and Applied
30
Enterprise Application Design Patterns: Improved and Applied
31
Enterprise Application Design Patterns: Improved and Applied
32
Enterprise Application Design Patterns: Improved and Applied
Cyclic ReferenceWhere to solve it?
• Input Mapper
Common Alternatives• Loading other Domain Objects after
February 2010 Stuart Thiel
Cyclic Reference Solution
33
Enterprise Application Design Patterns: Improved and Applied
Cyclic Reference alternativeEasy:
February 2010 Stuart Thiel
34
Enterprise Application Design Patterns: Improved and Applied
public Person find(long id) {
//Check Identity Map and return if found
if(IdentityMap.has(id,Person.class))
return IdentityMap.get(id,Person.class);
//Not in Identity Map
ResultSet rs = PersonFinder.find(id);
if(!rs.next) ;//
Person p = new Person(id);
UoW.getCurrent.registerClean(p);
Person buddy = find(rs.getLong("buddy"));
p.setBuddy(buddy);
}
February 2010 Stuart Thiel
35
Enterprise Application Design Patterns: Improved and Applied
Cyclic Reference alternativeHarder
February 2010 Stuart Thiel
36
Enterprise Application Design Patterns: Improved and Applied
public Person find(long id) {
//Check Identity Map and return if found
if(IdentityMap.has(id,Person.class))
return IdentityMap.get(id,Person.class);
//Not in Identity Map
ResultSet rs = PersonFinder.find(id);
if(!rs.next) ;//
Person p = new Person(id);
UoW.getCurrent.registerClean(p);
Pet pet = find(rs.getLong("pet"));
p.setPet(pet);
}
February 2010 Stuart Thiel
37
Enterprise Application Design Patterns: Improved and Applied
Proxypublic Person find(long id) {
//Check Identity Map and return if found
if(IdentityMap.has(id,Person.class))
return IdentityMap.get(id,Person.class);
//Not in Identity Map
ResultSet rs = PersonFinder.find(id);
if(!rs.next) ;//
Person p = new Person(id,
new PersonProxy(rs.getLong("buddy")));
UoW.getCurrent.registerClean(p);
}
February 2010 Stuart Thiel