![Page 1: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/1.jpg)
And patterns to help you avoid getting killed
Sander Hoogendoorn | Principal Technology Officer | Capgemini | @aahoogendoorn
ARC203 - HOW FRAMEWORKS CAN KILL YOUR PROJECTS
![Page 2: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/2.jpg)
2HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
Capgemini
� Principal technology officer
� Global agile thought leader
� Chief architect Accelerated Delivery Platform (ADP)
Other
� Microsoft Partner Advisory Council .NET
� Author books and articles in international magazines
� Appreciated speaker at international conferences
� Columns in several magazines
� Editorial boards
Web
� www.sanderhoogendoorn.com
� www.smartusecase.com
� Twitter: @aahoogendoorn
SANDER HOOGENDOORN
![Page 3: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/3.jpg)
3HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
ARC203 – How frameworks can kill your projects
� Tuesday 12:00
� Hall 3.2 Interactive 2
ARC202 - How frameworks can kill your projects
� Wednesday 13:20
� Hall 7.1b London 2
ARC203 – How frameworks can kill your projects (repeat)
� Thursday 10:30
� Hall 3.2 Interactive 6
ARC205 – How smart use cases drive web development
� Friday 10:30
� Hall 7.3 Berlin 1
SANDER HOOGENDOORN – TECHED 2010 SESSIONS
![Page 4: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/4.jpg)
4HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
AGENDA
An short story
about frameworks
How frameworks can
get you in trouble
Software architecture
versus frameworks
The layer
supertype
Introducing the
descriptor pattern
The
manager-provider
![Page 5: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/5.jpg)
5HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
AGENDA
An short story
about frameworks
How frameworks can
get you in trouble
Software architecture
versus frameworks
The layer
supertype
Introducing the
descriptor pattern
The
manager-provider
![Page 6: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/6.jpg)
It always takes longer than you expect,
even when you take into account Hofstadter’s Law
HOFSTADTER’S LAW
![Page 7: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/7.jpg)
7HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MYFIRSTSURVEY
![Page 8: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/8.jpg)
8HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MYFIRSTSURVEY
![Page 9: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/9.jpg)
Frameworks, like pizzas, come in only two sizes: too big and too small.
LIFE IS NEVER EASY …
![Page 10: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/10.jpg)
10HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MYFIRSTSURVEY
![Page 11: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/11.jpg)
11HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
WHAT’S IT GONNA BE PUNK?General purpose frameworks
Enterprise Library, Spring.Net, Castle, NakedObjects,
Accelerated Delivery Framework (ADF), SubSonic
Single goaled frameworks – verticals
Dependency injection: ObjectBuilder, Unity, Castle
Windsor
Logging: Log4Net, Logging Block, Common.Logging
Exception handling: Exception Handling Block
Apect orientation: PostSharp, SetPoint
Search: Lucene.net, NLucene
Portals: DotNetNukeSpatial, Umbraco
Single goaled frameworks – architectural
User interface: Silverlight, ASP.NET MVC, WPF, ASP.NET
Ajax, Spring MVC
Process: UI Process Application Block, WF
Domain: Entity Framework, Hibernate, NEO
Data: Entity Framework, Hibernate, Castle ActiveRecord, CSLA
Service s: WCF, WCF RIA
![Page 12: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/12.jpg)
12HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
FRAMEWORKS - CODEPLEX
![Page 13: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/13.jpg)
13HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
FRAMEWORKS – WWW.CSHARPOPENSOURCE.COM
![Page 14: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/14.jpg)
14HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
FRAMEWORKS – MICROSOFT ENTERPRISE LIBRARY
![Page 15: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/15.jpg)
15HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
FRAMEWORKS – PROJECT CASTLE
![Page 16: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/16.jpg)
16HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DON’T BELIEVE THE HYPE – IT’S A SQL
![Page 17: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/17.jpg)
17HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
CONVINCING THE MANAGEMENT TO APPLY THE FRAMEWORK (25.5 %)
![Page 18: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/18.jpg)
18HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
UNDERSTANDING THE FRAMEWORK (56.4 %)
![Page 19: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/19.jpg)
19HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
CONVINCING OTHER DEVELOPERS TO USE THE FRAMEWORK (23.6 %)
![Page 20: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/20.jpg)
20HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
TRAINING THE DEVELOPERS (20 %)
![Page 21: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/21.jpg)
21HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
THE EYE OF THE TIGER
![Page 22: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/22.jpg)
22HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
AGENDA
An short story
about frameworks
How frameworks can
get you in trouble
Software architecture
versus frameworks
The layer
supertype
Introducing the
descriptor pattern
The
manager-provider
![Page 23: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/23.jpg)
My software never has bugs. It just develops random features
APPLYING FRAMEWORKS
![Page 24: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/24.jpg)
24HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
SO GLAD YOU MADE IT!
What if we require
additional features that
aren’t covered by our
framework?
What if we decide that
another framework might
be better than the one
we’re using now?
What if the author of our
favorite framework suddenly
stops developing it?
What if the framework
contains bugs?
And what if the new version
of our framework is
implemented totally
different?
![Page 25: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/25.jpg)
25HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MORE THAN ANYTHING, DEPENDENCIES WILL KILL YOUR PROJECT
![Page 26: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/26.jpg)
A short story about framework developers and application developers
KENTUCKY FRIED ARCHITECTURE
![Page 27: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/27.jpg)
27HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
THE CUSTOMER IS NOT ALWAYS RIGHT
![Page 28: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/28.jpg)
28HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
PIGS & CHICKENS
The application
developer
The framework
developer
![Page 29: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/29.jpg)
29HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
KFC ARCHITECTURE – ENTITY FRAMEWORK
![Page 30: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/30.jpg)
30HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
KFC ARCHITECTURE – ENTITY FRAMEWORK
![Page 31: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/31.jpg)
31HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
KFC ARCHITECTURE – ENTITY FRAMEWORK
![Page 32: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/32.jpg)
I don’t care if it works on your machine! We are not shipping your machine!
LETTING THE LUNATICS RUN THE ASYLUM
Here’s … beta!
![Page 33: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/33.jpg)
33HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
ON THE WRONG TRACK
![Page 34: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/34.jpg)
34HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
HOT OR NOT?
Hot? From hot to not? Not?
HTML5
LightSwitch
WCF RIA Services
Silverlight 4.0
ASP.NET MVC 2 (3?)
ASP.NET Dynamic Data
ADO.NET Data Services
MEF
Azure Services
jQuery
NService Bus
Oslo
M
MGrammar
Expression Blend
ASP.NET Ajax
REST
Dublin
BizTalk
Surface
Duet
SketchFlow
Entity Framework 2.0
LINQ2SQL
LINQ2Entities
Entity Data Model
WPF
Unity
DSL’s
Silverlight 2.0
F#
ASP.NET
PopFly
![Page 35: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/35.jpg)
35HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
HERE’S JOHNNY! – ASP.NET MVC
![Page 36: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/36.jpg)
36HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
HERE’S JOHNNY! – ASP.NET MVC
![Page 37: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/37.jpg)
It’s only in theory that practice and theory are the same
NO STRINGS ATTACHED
![Page 38: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/38.jpg)
38HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MYFIRSTSURVEY
![Page 39: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/39.jpg)
39HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
CHANGING BASE CLASSES – – NHIBERNATE / LOG4NET
![Page 40: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/40.jpg)
40HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
CHANGING BASE CLASSES – NHIBERNATE / LOG4NET
![Page 41: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/41.jpg)
Programming is like sex.
One mistake and you have to support it for the rest of your life
YES, YOUR FRAMEWORKS VERSION TOO
![Page 42: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/42.jpg)
42HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
IT AIN’T OVER TILL IT’S OVER
![Page 43: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/43.jpg)
43HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MISSING BASE CLASSES – WORKFLOW FOUNDATION 4.0
![Page 44: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/44.jpg)
44HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MISSING BASE CLASSES – WORKFLOW FOUNDATION 4.0
![Page 45: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/45.jpg)
HOW TO AVOID GETTING KILLED
![Page 46: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/46.jpg)
46HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
AGENDA
An short story
about frameworks
How frameworks can
get you in trouble
Software architecture
versus frameworks
The layer
supertype
Introducing the
descriptor pattern
The
manager-provider
![Page 47: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/47.jpg)
Architecture starts when you carefully put two bricks together. There it begins.
SOUND ARCHITECTURE
![Page 48: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/48.jpg)
(SOFTWARE.ARCHITECTURE != LIST<FRAMEWORK>)
![Page 49: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/49.jpg)
49HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
A SOFTWARE ARCHITECTURE
![Page 50: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/50.jpg)
50HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
Presentation
Process
Domain
Data / Services
Outside world
Pages
UserControls
Panels
Use cases
Workflow
Domain objects / Entities
Factories / Repositories
Enums / Value objects / Smart references
[Mapping]
Service gateways
Service locators
[Mapping]
Databases
Services / ESB
Exact SAP BizTalk Java
Silverlight
XAML
Entities
(from EF)
Domain
Services
Metadata
Entity Framework
LINQ
Nhibernate?
MVVM?
MVP?
![Page 51: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/51.jpg)
51HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
THE GOOD, THE BAD AND THE UGLYDependencies
� Using frameworks is simply good, gringo
� However, being dependant on third parties
can put your project at risk
� How stable are the frameworks you use?
� How stable is the framework vendor?
Minimize dependencies
� Map frameworks to your software architecture,
not vice versa
� Define your own layer supertypes
� Wrap framework functionality
� Apply manager-provider pattern
� Implement extension methods if all fails
![Page 52: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/52.jpg)
52HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
AGENDA
An short story
about frameworks
How frameworks can
get you in trouble
Software architecture
versus frameworks
The layer
supertype
Introducing the
descriptor pattern
The
manager-provider
![Page 53: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/53.jpg)
From a programmer's point of view the user is a peripheral
that types when you issue a read request.
LAYER SUPERTYPE
![Page 54: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/54.jpg)
54HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
LAYER SUPERTYPE What’s a layer supertype Ollie?
� Acts as a supertype for all types in
its layer
� All types inherit from the layer
supertype
Well Stan, it’s characteristics are
� Name expresses common behaviour
� Forces common features on all inherited types
� Ideal starting point for services
� Initially the layer supertype is empty
� Reserve layer supertype for future additions
� Extension methods don’t (always) help, you know
![Page 55: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/55.jpg)
55HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
LAYER SUPERTYPE – ASP.NET MVC
![Page 56: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/56.jpg)
56HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
LAYER SUPERTYPE – ASP.NET MVC
![Page 57: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/57.jpg)
57HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
Presentation
Process
Domain
Data / Services
Outside world
Pages
UserControls
Panels
Use cases
Workflow
Domain objects / Entities
Factories / Repositories
Enums / Value objects / Smart references
[Mapping]
Service gateways
Service locators
[Mapping]
Databases
Services / ESB
Exact SAP BizTalk Java
![Page 58: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/58.jpg)
58HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
LAYER SUPERTYPE – USING A LAYER SUPERTYPE
![Page 59: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/59.jpg)
59HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
LAYER SUPERTYPE – DEFINE SERVICES ON LAYER SUPERTYPES
![Page 60: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/60.jpg)
60HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
LAYER SUPERTYPE – EXTENSION METHODS ON LAYER SUPERTYPES
![Page 61: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/61.jpg)
61HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
AGENDA
An short story
about frameworks
How frameworks can
get you in trouble
Software architecture
versus frameworks
The layer
supertype
Introducing the
descriptor pattern
The
manager-provider
![Page 62: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/62.jpg)
Always code as if the guy who ends up maintaining your code
will be a violent psychopath who knows where you live.
DESCRIPTOR
![Page 63: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/63.jpg)
63HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
I KNOW NOTHING. I’M FROM BARCELONA
What is the matter
Mister Fawlty?
The problem Manual, is that
� I want to use constants in my
application
� But I want to define them in my
framework and extend them in my
application
� Enumeration won’t do – there’s no
inheritance
![Page 64: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/64.jpg)
64HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DESCRIPTOR – THE PROBLEM (1)
![Page 65: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/65.jpg)
65HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DESCRIPTOR – THE PROBLEM (2)
![Page 66: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/66.jpg)
66HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
ENUM?
![Page 67: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/67.jpg)
67HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
STRING COLLECTION?
![Page 68: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/68.jpg)
68HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
STRING COLLECTION
![Page 69: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/69.jpg)
69HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
I KNOW NOTHING. I’M FROM BARCELONA
Descriptor
Defines a restricted but
application specific
extendible list of
definitions
Useful when
� Enums can not be inherited
� Framework defines enumerationtypes that need to be extended in application code
� Define layer supertype usingreflection
� Pre-define frequently used instances
![Page 70: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/70.jpg)
70HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DESCRIPTOR PATTERN
![Page 71: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/71.jpg)
71HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DESCRIPTOR PATTERN - DEFINITION
![Page 72: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/72.jpg)
72HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DESCRIPTOR PATTERN – EXTENDED DEFINITION
![Page 73: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/73.jpg)
73HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DESCRIPTOR PATTERN – USE IN FRAMEWORK
![Page 74: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/74.jpg)
74HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DESCRIPTOR PATTERN – USE IN APPLICATION
![Page 75: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/75.jpg)
75HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MYFIRSTSURVEY
![Page 76: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/76.jpg)
76HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DESCRIPTOR PATTERN – USE IN ASP.NET MVC
![Page 77: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/77.jpg)
77HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DESCRIPTOR PATTERN – USE IN ASP.NET MVC
![Page 78: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/78.jpg)
78HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
AGENDA
An short story
about frameworks
How frameworks can
get you in trouble
Software architecture
versus frameworks
The layer
supertype
Introducing the
descriptor pattern
The
manager-provider
![Page 79: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/79.jpg)
XML is like violence.
If it doesn’t solve your problems, you are not using enough of it.
DEPENDENCY INJECTION
![Page 80: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/80.jpg)
80HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
A NEW DISEASE?What do you think it is?
Create true separation between definition and implementation, so that the two can vary independently and can be replaced easily
Looks like a typical case of dependency
injection to me
� Call functionality without having to know
the actual implementation
� Implement replaceable services
� Apply implementations in different contexts
� Plug-in services at run-time
So …
� Single topic services
� Single or multiple implemenationsneed to be handled, which differsdependant on context, like withWindows API, logging or errorhandling
� Unit testing
![Page 81: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/81.jpg)
81HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DIFFERENT VARIATIONS?Did you know that there
are different types of this
dependency injection?
Arggh…
Yeah, sure. There’s
� Constructor injection
� Property (setter) injection
� And even manual injectionWho cares doc?
![Page 82: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/82.jpg)
82HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DEPENDENCY INJECTION – CONSTRUCTOR INJECTION
![Page 83: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/83.jpg)
83HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DEPENDENCY INJECTION – MANUAL INJECTION
c
![Page 84: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/84.jpg)
84HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
DEPENDENCY INJECTION – WHAT TO PLUG IN
Yes, XML will hurt you too!
![Page 85: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/85.jpg)
"Teamwork is a lot of people doing what I say“
Marketing executive, Citrix Corporation
MANAGER – PROVIDER
![Page 86: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/86.jpg)
86HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
Definition
� Create a simple static facade (manager) for
a (set of) interfaced implementations
(providers)
In practice
� Manager holds one or a collection of
providers
� Provider implement a particular interface
� Manager has methods to call methods
from interface
� At run-time, using dependency injection,
actual providers are injected
MANAGER-PROVIDER PATTERN
![Page 87: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/87.jpg)
87HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MANAGER – VALIDATIONMANAGER
![Page 88: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/88.jpg)
88HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
INTERFACE
![Page 89: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/89.jpg)
89HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MANAGER – INITIALIZATION (USING DEPENDENCY INJECTION)
![Page 90: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/90.jpg)
90HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
CONFIGURATION OF IMPLEMENTATION
![Page 91: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/91.jpg)
91HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
MANAGER - EXECUTING METHODS
![Page 92: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/92.jpg)
92HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
CLIENT – CALLING METHODS
![Page 93: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/93.jpg)
93HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
Useful when
� Generic services need to be called, which may have different implementations
� Manager prevents having to loop through each of a list of providers
� Flexibility to add or remove providers without changing application code
� Providers differ e.g. in development code, test code or deployed code
Use for
� Task Management
� View Management
� Binding and Persisting
� Resource Management
� State Management
� Logging
� Datasource interaction
� Testing!
MANAGER-PROVIDER PATTERN
![Page 94: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/94.jpg)
94HOW FRAMEWORKS CAN KILL YOUR PROJECTS©2010 Capgemini. All Rights Reserved
THE GOOD, THE BAD AND THE UGLYDependencies
� Using frameworks is simply good, gringo
� However, being dependant on third parties
can put your project at risk
� How stable are the frameworks you use?
� How stable is the framework vendor?
Minimize dependencies
� Map frameworks to your software architecture,
not vice versa
� Define your own layer supertypes
� Wrap framework functionality
� Apply manager-provider pattern
� Implement extension methods if all fails
![Page 95: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/95.jpg)
www.accelerateddeliveryplatform.com
WWW.SMARTUSECASE.COM
![Page 96: 20101109 (tech ed) how frameworks kill projects](https://reader033.vdocuments.mx/reader033/viewer/2022052321/555612b9d8b42a3f168b5073/html5/thumbnails/96.jpg)
www.sanderhoogendoorn.com | www.smartusecase.com
Twitter: @aahoogendoorn
REFERENCES AND QUESTIONS