Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.
-
Upload
willis-benson -
Category
Documents
-
view
214 -
download
0
Transcript of Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.
![Page 1: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/1.jpg)
How Frameworks Can Kill Your Project And Patterns Can Prevent You From Getting KilledSander HoogendoornPrincipal Technology OfficerCapgemini The Netherlands
SESSION CODE: ARC303
![Page 2: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/2.jpg)
Sander HoogendoornCapgemini
Principal technology officer Agile thought leaderAccelerated Delivery Platform
OtherAuthor books (UML, agile) and articlesSpeaker at international conferencesMicrosoft Partner Advisory Council .NETColumnist several magazinesMember several editorial boards
Webwww.sanderhoogendoorn.comwww.smartusecase.comTwitter: @aahoogendoornLinkedIn: aahoogendoorn
![Page 3: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/3.jpg)
Talk MyTalk = new Talk();
MyTalk.Subject != new Framework()
![Page 4: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/4.jpg)
if (MyTalk.Subject != new Framework()){
MyTalk.Subject = new List<Framework>();}
![Page 5: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/5.jpg)
MyTalk(t => t.Subject).Select(new Framework()).Discuss(new List<AntiPattern>).Discuss(new List<Pattern>).ShowSome(Code).HaveFun();
![Page 6: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/6.jpg)
Gartner says …
![Page 7: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/7.jpg)
MyFirstSurvey
![Page 8: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/8.jpg)
Hofstadter’s LawIt always takes longer than you expect, even when you take into account Hofstadter’s Law
![Page 9: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/9.jpg)
MyTalk(t => t.Subject).Select(new Framework()).Discuss(new List<AntiPattern>).Discuss(new List<Pattern>).ShowSome(Code).HaveFun();
![Page 10: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/10.jpg)
Life is never easy …Frameworks, like pizzas, only come in only two sizes: too big and too small.
![Page 11: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/11.jpg)
MyFirstSurvey
![Page 12: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/12.jpg)
MyFirstSurvey
![Page 13: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/13.jpg)
What’s it gonna be?General Purpose Frameworks
Enterprise Library, Spring.Net, Castle, NakedObjects, ADF, SubSonic, …
Single goaled frameworks – verticals
Dependency injection: ObjectBuilder, Unity, Castle Windsor, (MEF)
Logging: Log4Net, Logging Block, Common.Logging
Exception handling: Exception Handling Block
Apect orientation: PostSharp, SetPoint
Search: Lucene.net, NLucene
Portals: DotNetNuke, Umbraco, Orchard CMS
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, NHibernate, NEO
Data: Entity Framework, Hibernate, Castle ActiveRecord, CSLA
Services: WCF, WCF RIA
![Page 14: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/14.jpg)
Frameworks – www.codeplex.com
![Page 15: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/15.jpg)
Frameworks – www.csharpopensource.com
![Page 16: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/16.jpg)
Frameworks – Microsoft Enterprise Library
![Page 17: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/17.jpg)
Frameworks – Project Castle
![Page 18: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/18.jpg)
Don’t believe the hype – It’s a SQL
![Page 19: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/19.jpg)
MyFirstSurvey
![Page 20: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/20.jpg)
Convincing the management to apply the framework (25.5 %)
![Page 21: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/21.jpg)
Understanding the framework (56.4 %)
![Page 22: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/22.jpg)
Convincing the developers to use the framework (23.6 %)
![Page 23: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/23.jpg)
Training the developers (20 %)
![Page 24: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/24.jpg)
The eye of the tiger
![Page 25: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/25.jpg)
MyTalk(t => t.Subject).Select(new Framework()).Discuss(new List<AntiPattern>).Discuss(new List<Pattern>).ShowSome(Code).HaveFun();
![Page 26: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/26.jpg)
FrameworksThe way out of trouble is never as simple as the way in.
![Page 27: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/27.jpg)
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 28: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/28.jpg)
Pig & Chicken Architecture
![Page 29: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/29.jpg)
Pigs & Chickens
An applicationdeveloper
A frameworkdeveloper
![Page 30: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/30.jpg)
Pig & Chicken Architecture – Entity Framework
![Page 31: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/31.jpg)
KFC Architecture – Entity Framework
![Page 32: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/32.jpg)
KFC Architecture – Entity Framework
![Page 33: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/33.jpg)
Letting the lunatics run the asylum
I don’t care if it works on your machine!We are not shipping your machine!
Here’s … beta!
![Page 34: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/34.jpg)
Here’s Johnny! – ASP.NET MVC
![Page 35: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/35.jpg)
Here’s Johnny! – ASP.NET MVC
![Page 36: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/36.jpg)
Here’s Johnny! – StructureMap 2.5
![Page 37: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/37.jpg)
Blog based documentation
![Page 38: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/38.jpg)
No strings attachedOnly in theory, practice and theory are the same
![Page 39: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/39.jpg)
MyFirstSurvey
![Page 40: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/40.jpg)
Changing base classes – – NHibernate / Log4Net
![Page 41: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/41.jpg)
Changing base classes – NHibernate / Log4Net
![Page 42: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/42.jpg)
If anything, dependencies will kill your project
![Page 43: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/43.jpg)
Yes, your frameworks version too
![Page 44: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/44.jpg)
It ain’t over till it’s over
End of lifecycle?
![Page 45: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/45.jpg)
Missing base classes – Workflow Foundation 4.0
![Page 46: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/46.jpg)
Missing base classes – Workflow Foundation 4.0
![Page 47: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/47.jpg)
MyTalk(t => t.Subject).Select(new Framework()).Discuss(new List<AntiPattern>).Discuss(new List<Pattern>).ShowSome(Code).HaveFun();
![Page 48: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/48.jpg)
How to avoid getting killedSome basic patterns that might help you
![Page 49: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/49.jpg)
The good, the bad and the ugly Dependencies
Using frameworks is simply good, gringo
However, be very aware of dependencies
Minimize dependencies Frameworks reflect software architecture, not vice
versa
Define your own layer supertypes
Apply dependency injecton / extensibility
Apply additional patterns
Many more patterns, some very basic, will increase minimizing dependencies
![Page 50: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/50.jpg)
Sound architectureArchitecture starts when you carefully put two bricks together. There it begins.
![Page 51: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/51.jpg)
Software architectures …
![Page 52: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/52.jpg)
Presentation
Process
Domain
Data / Services
Outside world
PagesUserControls
Panels
Use casesWorkflow
Domain objects / EntitiesFactories / Repositories
Enums / Value objects / Smart references[Mapping]
Service gatewaysService locators
[Mapping]
DatabasesServices / ESB
Peoplesoft SAP BizTalk Java
Software architecture vs frameworks
• Software architecture is leading• Layers, elements, responsibilities,
collaboration• Frameworks supports architecture!• Code reflects architecture
![Page 53: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/53.jpg)
Layer supertypeFrom a programmer's point of viewthe user is a peripheral that types when you issue a read request.
![Page 54: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/54.jpg)
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: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/55.jpg)
Layer Supertype – Interface?
![Page 56: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/56.jpg)
Layer Supertype - Basic
![Page 57: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/57.jpg)
Layer Supertype – ASP.NET MVC
![Page 58: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/58.jpg)
Layer Supertype – ASP.NET MVC
![Page 59: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/59.jpg)
Layer Supertype - Inherited
![Page 60: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/60.jpg)
Layer Supertype - Inherited
![Page 61: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/61.jpg)
Layer Supertype - Inherited
![Page 62: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/62.jpg)
Layer Supertype – Defining services
![Page 63: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/63.jpg)
MyTalk(t => t.Subject).Select(new Framework()).Discuss(new List<AntiPattern>).Discuss(new List<Pattern>).ShowSome(Code).HaveFun();
![Page 64: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/64.jpg)
DescriptorAlways code as if the guy who ends up maintainingyour code will be a violent psychopath who knows where you live.
![Page 65: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/65.jpg)
I know nothing. I’m from Barcelona
What is the matterMister 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[PrincipalPermission(SecurityAction.Demand, Role = "Teller")]
![Page 66: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/66.jpg)
Enum?
![Page 67: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/67.jpg)
String Collection
![Page 68: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/68.jpg)
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 enumeration types that need to be extended in application code
Define layer supertype using reflection
Pre-define frequently used instances
[PrincipalPermission(SecurityAction.Demand, Roles.Teller)]
![Page 69: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/69.jpg)
Descriptor Pattern – In use
![Page 70: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/70.jpg)
Descriptor Pattern
DEMO
![Page 71: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/71.jpg)
MyFirstSurvey
![Page 72: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/72.jpg)
Descriptor Pattern – Use in ASP.NET MVC
![Page 73: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/73.jpg)
Descriptor Pattern – Use in ASP.NET MVC
![Page 74: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/74.jpg)
Descriptor PatternIn ASP.NET MVC
DEMO
![Page 75: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/75.jpg)
Dependency injection (DI)XML is like violence - if it doesn’t solve your problems, you are not using enough of it.
![Page 76: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/76.jpg)
DI? 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 implemenations need to be handled, which differs dependant on context, like with Windows API, logging or error handling
Unit testing
![Page 77: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/77.jpg)
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 injection
Extending MEF style? Who cares doc?
![Page 78: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/78.jpg)
Dependency injectionConstructor injection, setter injection, manual injection
DEMO
![Page 79: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/79.jpg)
Dependency injection – Configuration files
Yes, XML will hurt you too!
![Page 80: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/80.jpg)
Manager – Provider"Teamwork is a lot of people doing what I say“
![Page 81: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/81.jpg)
TeamworkDefinition The manager-provider pattern creates a simple facade for a (set
of) interfaced implementation(s)
In practice Facade holding one or a collection of instances of a particular
interface
Methods to call methods from interface
At run-time, using dependency injection, actual implementation are injected
Useful when Generic services need to be called, which may have different
implementations
Manager prevents having to loop through each of a list of implementation
Flexibility to add or remove implementation without change the application code
![Page 82: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/82.jpg)
Manager – ValidationManager
![Page 83: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/83.jpg)
Manager – ValidationManager
![Page 84: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/84.jpg)
Provider – IValidationHandler
![Page 85: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/85.jpg)
Manager – ValidationManager
![Page 86: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/86.jpg)
Client – A use case
![Page 87: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/87.jpg)
Manager provider
DEMO
![Page 88: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/88.jpg)
The good, the bad and the ugly Dependencies
Using frameworks is simply good, gringo
However, be very aware of dependencies
Minimize dependencies Frameworks reflect software architecture, not vice
versa
Define your own layer supertypes
Apply dependency injecton / extensibility
Apply additional patterns
Many more patterns, some very basic, will increase minimizing dependencies
![Page 89: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/89.jpg)
if (MyFramework.AntiPatterns.Count > 3){
throw new FrameworkKilledProjectException();}
![Page 90: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/90.jpg)
catch(FrameworkKilledProjectException e){
MyFramework.Apply(List<Pattern>);}finally{
MyApplication.Coupling = Couplings.Loose;}
![Page 91: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/91.jpg)
MyTalk(t => t.Subject).Select(new Framework()).Discuss(new List<AntiPattern>).Discuss(new List<Pattern>).ShowSome(Code).HaveFun();
![Page 92: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/92.jpg)
References and questionswww.accelerateddeliveryplatform.comwww.sanderhoogendoorn.comorsander.hoogendoorn@capgemini.com LinkedIn: aahoogendoorn Twitter: @aahoogendoorn
![Page 93: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/93.jpg)
Resources
www.microsoft.com/teched
Sessions On-Demand & Community Microsoft Certification & Training Resources
Resources for IT Professionals Resources for Developers
www.microsoft.com/learning
http://microsoft.com/technet http://microsoft.com/msdn
Learning
![Page 94: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/94.jpg)
Complete an evaluation on CommNet and enter to win!
![Page 95: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/95.jpg)
Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st
http://northamerica.msteched.com/registration
You can also register at the
North America 2011 kiosk located at registrationJoin us in Atlanta next year
![Page 96: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/96.jpg)
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to
be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
![Page 97: Sander Hoogendoorn Principal Technology Officer Capgemini The Netherlands SESSION CODE: ARC303.](https://reader036.fdocuments.in/reader036/viewer/2022062802/56649ec15503460f94bcd94a/html5/thumbnails/97.jpg)
JUNE 7-10, 2010 | NEW ORLEANS, LA