102
HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS Sander Hoogendoorn | Principal Technology Officer, Global Agile Thought Leader | Capgemini www.sanderhoogendoorn.com | [email protected] | @aahoogendoorn

Agile and Frameworks

Embed Size (px)

DESCRIPTION

Slide deck for my talk at the Avisi Software Architecture Symposium 2012.

Citation preview

Page 1: Agile and Frameworks

HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTSSander Hoogendoorn | Principal Technology Officer, Global Agile Thought Leader | Capgeminiwww.sanderhoogendoorn.com | [email protected] | @aahoogendoorn

Page 2: Agile and Frameworks

2 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

SANDER HOOGENDOORN

Capgemini

� Principal technology officer

� Global agile thought leader

� Chief architect Accelerated Delivery Platform (ADP)

Other

� Author books on UML, agile

� Author +200 articles, columns

� Speaker +100 international conferences and seminars

� Microsoft Partner Advisory Council .NET

� Editorial boards & Advisory boards

� Capping IT Off Blog

Web

� www.sanderhoogendoorn.com

� www.ditisagile.nl | www.smartusecase.com

[email protected]

� @aahoogendoorn @ditisagile

Page 3: Agile and Frameworks

3 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

Page 4: Agile and Frameworks

4 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

Page 5: Agile and Frameworks

5 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

AGENDA

An short storyabout frameworks

How frameworks canget you in trouble

Software architectureversus frameworks

The layersupertype

Introducing thedescriptor pattern

The manager-provider

Page 6: Agile and Frameworks

6 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

AGENDA

An short storyabout frameworks

How frameworks canget you in trouble

Software architectureversus frameworks

The layersupertype

Introducing thedescriptor pattern

The manager-provider

Page 7: Agile and Frameworks

7 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

WATERFALL? BIG-UP FRONT?

Architecture!

Page 8: Agile and Frameworks

8 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

WATERFALL? BIG-UP FRONT?

Page 9: Agile and Frameworks

9 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

THE WATERFALL DENTIST

Page 10: Agile and Frameworks

10 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

BOEHM’S LAW

Page 11: Agile and Frameworks

11 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

Page 12: Agile and Frameworks

12 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

AGILE. NO UP-FRONT?

Architecture?

Page 13: Agile and Frameworks

13 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

BOEHM’S LAW. PER ITERATION

Page 14: Agile and Frameworks

14 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

AGILE. SOME UP-FRONT

Just enougharchitecting!

Frameworks?

Page 15: Agile and Frameworks

It always takes longer than you expect, even when you take into account Hofstadter’s Law

HOFSTADTER’S LAW

Page 16: Agile and Frameworks

16 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MYFIRSTSURVEY

Page 17: Agile and Frameworks

Frameworks, like pizzas, come in only two sizes: too big and too small.

LIFE IS NEVER EASY …

Page 18: Agile and Frameworks

18 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MYFIRSTSURVEY

Page 19: Agile and Frameworks

19 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. 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 20: Agile and Frameworks

20 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

FRAMEWORKS - CODEPLEX

Page 21: Agile and Frameworks

21 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

FRAMEWORKS – WWW.CSHARPOPENSOURCE.COM

Page 22: Agile and Frameworks

22 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

FRAMEWORKS – MICROSOFT ENTERPRISE LIBRARY

Page 23: Agile and Frameworks

23 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

FRAMEWORKS – PROJECT CASTLE

Page 24: Agile and Frameworks

24 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DON’T BELIEVE THE HYPE – IT’S A SQL

Page 25: Agile and Frameworks

25 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

CONVINCING THE MANAGEMENT TO APPLY THE FRAMEWORK (25.5 %)

Page 26: Agile and Frameworks

26 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

UNDERSTANDING THE FRAMEWORK (56.4 %)

Page 27: Agile and Frameworks

27 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

CONVINCING OTHER DEVELOPERS TO USE THE FRAMEWORK (23.6 %)

Page 28: Agile and Frameworks

28 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

CONVINCING OTHER DEVELOPERS TO USE THE FRAMEWORK (23.6 %)

Page 29: Agile and Frameworks

29 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

TRAINING THE DEVELOPERS (20 %)

Page 30: Agile and Frameworks

30 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

THE EYE OF THE TIGER

Page 31: Agile and Frameworks

31 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

AGENDA

An short storyabout frameworks

How frameworks canget you in trouble

Software architectureversus frameworks

The layersupertype

Introducing thedescriptor pattern

The manager-provider

Page 32: Agile and Frameworks

My software never has bugs. It just develops random features

APPLYING FRAMEWORKS

Page 33: Agile and Frameworks

33 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

AGILE. SOME UP-FRONT

Just enougharchitecting!

Frameworks? Just enoughre-architecting

Page 34: Agile and Frameworks

34 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

SO GLAD YOU MADE IT!

What if we requireadditional features thataren’t covered by our

framework?

What if we decide thatanother framework mightbe better than the onewe’re using now?

What if the author of ourfavorite framework suddenly

stops developing it?

What if the framework contains bugs?

And what if the new versionof our framework is implemented totally

different?

Page 35: Agile and Frameworks

35 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MORE THAN ANYTHING, DEPENDENCIES WILL KILL YOUR PROJECT

Page 36: Agile and Frameworks

A short story about framework developers and application developers

KENTUCKY FRIED ARCHITECTURE

Page 37: Agile and Frameworks

37 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

PIGS & CHICKENS

The applicationdeveloper

The frameworkdeveloper

Page 38: Agile and Frameworks

38 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

KFC ARCHITECTURE – ENTITY FRAMEWORK

Page 39: Agile and Frameworks

39 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

KFC ARCHITECTURE – ENTITY FRAMEWORK

Page 40: Agile and Frameworks

40 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

KFC ARCHITECTURE – ENTITY FRAMEWORK

Page 41: Agile and Frameworks

I don’t care if it works on your machine! We are not shipping your machine!

LETTING THE LUNATICS RUN THE ASYLUM

Here’sHere’sHere’sHere’s … … … … betabetabetabeta!!!!

Page 42: Agile and Frameworks

42 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

HOT OR NOT?

Hot? From hot to not? Not?

Metro

HTML5

LightSwitch

WCF RIA Services

Silverlight 4.0?

ASP.NET MVC 3

MEF

jQuery

NService Bus

Entity Framework - Code First

Expression Blend

ASP.NET Ajax

REST

Unity

BizTalk

Surface

Duet

SketchFlow

Azure Services

ADO.NET Data Services

ASP.NET Dynamic Data

WPF

Entity Framework 2.0

LINQ2SQL

LINQ2Entities

Entity Data Model

Dublin

DSL’s

Silverlight 2.0

F#

ASP.NET

PopFly

M

Oslo

MGrammar

Page 43: Agile and Frameworks

43 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

BE A F***ING GENIUS

Metro?

WTF? I just figured out ASP.NET MVC

Page 44: Agile and Frameworks

44 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

HERE’S JOHNNY! – ASP.NET MVC

Page 45: Agile and Frameworks

45 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

HERE’S JOHNNY! – ASP.NET MVC

Page 46: Agile and Frameworks

It’s only in theory that practice and theory are the same

NO STRINGS ATTACHED

Page 47: Agile and Frameworks

47 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MYFIRSTSURVEY

Page 48: Agile and Frameworks

48 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

CHANGING BASE CLASSES – – NHIBERNATE / LOG4NET

Page 49: Agile and Frameworks

49 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

CHANGING BASE CLASSES – NHIBERNATE / LOG4NET

Page 50: Agile and Frameworks

Programming is like sex. One mistake and you have to support it for the rest of your life

YES, YOUR FRAMEWORKS VERSION TOO

Page 51: Agile and Frameworks

51 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

IT AIN’T OVER TILL IT’S OVER

Page 52: Agile and Frameworks

52 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MISSING BASE CLASSES – WORKFLOW FOUNDATION 4.0

Page 53: Agile and Frameworks

53 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MISSING BASE CLASSES – WORKFLOW FOUNDATION 4.0

Page 54: Agile and Frameworks

54 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

AGENDA

An short storyabout frameworks

How frameworks canget you in trouble

Software architectureversus frameworks

The layersupertype

Introducing thedescriptor pattern

The manager-provider

Page 55: Agile and Frameworks

Architecture starts when you carefully put two bricks together. There it begins.

SOUND ARCHITECTURE

Page 56: Agile and Frameworks

(SOFTWARE.ARCHITECTURE != LIST<FRAMEWORK>)

Page 57: Agile and Frameworks

57 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

A SOFTWARE ARCHITECTURE

Page 58: Agile and Frameworks

58 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

Presentation

Process

Domain

Data / Services

Outside world

PagesUserControls

Panels

Use casesWorkflow

Domain objects / EntitiesFactories / Repositories

Enums / Value objects / Smart references

Service gatewaysService locators

[Mapping]

DatabasesServices / ESB

Exact SAP BizTalk Java

Android?XAML?ASPX?

Entities(from EF)

DomainServices

Metadata?JSON?

EF?LINQ?

Nhibernate?

MVVM?MVP?

MVWTF?

What to do?

• Identify your architectural requirements

• Set up a (layered) architecture

• Identify layers and layer elements

• List the elements responsibilities

• List the elements collaborations

• And only then map to frameworks

• Create a thin “umbrella” of independence

responsible for managing dependencies

Page 59: Agile and Frameworks

From a developers point of view the user is a peripheral that types when you issue a read request.

LAYER SUPERTYPE

Page 60: Agile and Frameworks

60 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. 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 61: Agile and Frameworks

61 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

LAYER SUPERTYPE – ASP.NET MVC

Page 62: Agile and Frameworks

62 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

LAYER SUPERTYPE – ASP.NET MVC

Page 63: Agile and Frameworks

63 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

Presentation

Process

Domain

Data / Services

Outside world

PagesUserControls

Panels

Use casesWorkflow

Domain objects / EntitiesFactories / Repositories

Enums / Value objects / Smart references

Service gatewaysService locators

[Mapping]

DatabasesServices / ESB

Exact SAP BizTalk Java

Page 64: Agile and Frameworks

64 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

LAYER SUPERTYPE – USING A LAYER SUPERTYPE

Page 65: Agile and Frameworks

65 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

LAYER SUPERTYPE – REASON ABOUT LAYER SUPERTYPES

Page 66: Agile and Frameworks

66 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

LAYER SUPERTYPE – EXTENSION METHODS ON LAYER SUPERTYPES

Page 67: Agile and Frameworks

67 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

AGENDA

An short storyabout frameworks

How frameworks canget you in trouble

Software architectureversus frameworks

The layersupertype

Introducing thedescriptor pattern

The manager-provider

Page 68: Agile and Frameworks

Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.

DESCRIPTOR

Page 69: Agile and Frameworks

69 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

I KNOW NOTHING. I’M FROM BARCELONA

What is the matterMister Fawlty?

The problem Manuel, is that

� I want to use constants in myapplication

� But I want to define them in myframework and extend them in myapplication

� Enumeration won’t do – there’s noinheritance

Page 70: Agile and Frameworks

70 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DESCRIPTOR – THE PROBLEM (1)

Page 71: Agile and Frameworks

71 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DESCRIPTOR – THE PROBLEM (2)

Page 72: Agile and Frameworks

72 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

ENUM?

Page 73: Agile and Frameworks

73 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

STRING COLLECTION?

Page 74: Agile and Frameworks

74 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

STRING COLLECTION

Page 75: Agile and Frameworks

75 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

I KNOW NOTHING. I’M FROM BARCELONA

Descriptor

Defines a restricted butapplication specificextendible list of definitions

Useful when

� Enums can not be inherited

� Framework defines enumeration types thatneed to be extended in application code

� Define layer supertype using reflection

� Pre-define frequently used instances

Page 76: Agile and Frameworks

76 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DESCRIPTOR PATTERN

Page 77: Agile and Frameworks

77 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DESCRIPTOR PATTERN - DEFINITION

Page 78: Agile and Frameworks

78 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DESCRIPTOR PATTERN – EXTENDED DEFINITION

Page 79: Agile and Frameworks

79 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DESCRIPTOR PATTERN – USE IN FRAMEWORK

Page 80: Agile and Frameworks

80 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DESCRIPTOR PATTERN – USE IN APPLICATION

Page 81: Agile and Frameworks

81 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MYFIRSTSURVEY

Page 82: Agile and Frameworks

82 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DESCRIPTOR PATTERN – USE IN ASP.NET MVC

Page 83: Agile and Frameworks

83 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DESCRIPTOR PATTERN – USE IN ASP.NET MVC

Page 84: Agile and Frameworks

84 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

AGENDA

An short storyabout frameworks

How frameworks canget you in trouble

Software architectureversus frameworks

The layersupertype

Introducing thedescriptor pattern

The manager-provider

Page 85: Agile and Frameworks

XML is like violence. If it doesn’t solve your problems, you are not using enough of it.

DEPENDENCY INJECTION

Page 86: Agile and Frameworks

86 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. 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

� Call functionality without having to knowthe 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 oncontext, like with Windows API, logging orerror handling

� Unit testing

Page 87: Agile and Frameworks

87 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DIFFERENT VARIATIONS? Did you know that thereare different types of this dependency injection?

Arggh…Yeah, sure. There’s

� Constructor injection

� Property (setter) injection

� And even manual injection Who cares doc?

Page 88: Agile and Frameworks

88 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DEPENDENCY INJECTION – CONSTRUCTOR INJECTION

Page 89: Agile and Frameworks

89 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DEPENDENCY INJECTION – MANUAL INJECTION

c

Page 90: Agile and Frameworks

90 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

DEPENDENCY INJECTION – WHAT TO PLUG IN

Page 91: Agile and Frameworks

"Teamwork is a lot of people doing what I say“ - Marketing executive, Citrix Corporation

MANAGER – PROVIDER

Page 92: Agile and Frameworks

92 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. 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 93: Agile and Frameworks

93 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MANAGER – VALIDATIONMANAGER

Page 94: Agile and Frameworks

94 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

INTERFACE

Page 95: Agile and Frameworks

95 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MANAGER – INITIALIZATION (USING DEPENDENCY INJECTION)

Page 96: Agile and Frameworks

96 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

CONFIGURATION OF IMPLEMENTATION

Page 97: Agile and Frameworks

97 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MANAGER - EXECUTING METHODS

Page 98: Agile and Frameworks

98 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

CLIENT – CALLING METHODS

Page 99: Agile and Frameworks

99 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

MANAGER-PROVIDER PATTERN

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!

Page 100: Agile and Frameworks

Re-factoring or re-architecting?

ARCHITECTURAL CHANGES IN AGILE?

Page 101: Agile and Frameworks

101 HOW FRAMEWORKS CAN KILL YOUR AGILE PROJECTS©2012 Sander Hoogendoorn. All Rights Reserved

Presentation

Process

Domain

Data / Services

Outside world

PagesUserControls

Panels

Use casesWorkflow

Domain objects / EntitiesFactories / Repositories

Enums / Value objects / Smart references

Service gatewaysService locators

[Mapping]

DatabasesServices / ESB

Exact SAP BizTalk Java

What to do?

• Identify your architectural requirements

• Set up a (layered) architecture

• Identify layers and layer elements

• List the elements responsibilities

• List the elements collaborations

• And only then map to frameworks

• Create a thin “umbrella” of independence

responsible for managing dependencies

Page 102: Agile and Frameworks

[email protected] | [email protected] | @aahoogendoorn | @ditisagilewww.sanderhoogendoorn.com | www.ditisagile.nl | www.smartusecase.com | www.accelerateddeliveryplatform.com

REFERENCES AND QUESTIONS