How Smart Use Cases Drive Web Development: Sander Hoogendoorn
How Smart Use Cases Drive Web Development: Sander Hoogendoorn
Sander Hoogendoorn
Principal Technology Officer Capgemini
SANDER HOOGENDOORN
Capgemini
Principal technology officer Global agile thought leader Chief architect Accelerated Delivery Platform (ADP)
Other
Author books and +200 articles in international magazines Appreciated speaker at +80 international conferences Microsoft Partner Advisory Council .NET Capping IT Off Blog Columns in Software Release Magazine, SDN Magazine Editorial boards Software Release Magazine, TiTM Advisory board @Portunity
Web
www.sanderhoogendoorn.com www.smartusecase.com Twitter / LinkedIn : aahoogendoorn
AGENDA
AGENDA
COMPLEX IT LANDSCAPES
HUGE CASES
Summary
Fish level
Sub-function
Clam level
Too low
10
Granularity
Different
Unified
Traceability
Possible
Normal
Testability
Poor
Good
11
AGENDA
12
Consequences
No room for new or changing insights Possibly unnecessary work
Therefore
Eliminate waste Maximize the amount of work not done Postpone work until you really need it
Benefits
No unnecessary analysis and design work Allows for new and changing insights No handover, immediate feedback
14
B D
A B C
Hierarchical Processes
C D
E D D F
Project Scope
Hierarchical Processes
Use Cases
Chronological Processes
15
CLOUD LEVEL
16
KITE LEVEL
17
18
19
20
21
23
AGENDA
24
Service consumer
Domain oriented Data provided by service or middleware But protocol independent (SOAP or REST?)
Service provider
Service oriented Data provided by contacts But domain oriented using data contracts
26
Presentation
Process
Domain
Domain objects / Entities Factories / Repositories Enums / Value objects / Smart references [Mapping]
Data / Services
Outside world
Database
27
Presentation
Process
Domain
Domain objects / Entities Factories / Repositories Enums / Value objects / Smart references [Mapping]
Data / Services
SAP
BizTalk
28
Presentation
Process
Domain
Domain objects / Entities Factories / Repositories Enums / Value objects / Smart references [Mapping]
Data / Services
Table Gateways / Service Gateways Queries / Service Locators [Mapping] Exact SAP BizTalk Java Database Services / ESB
Outside world
29
ARCHITECTURE IN CODE
Web
Pages, controls
Process
Use cases / Tasks / Flow
Domain
Factories / Repositories Domain Objects / Business rules Enums / Value Objects / References Search Objects
Data / Services
Gateways Mappings / Describers
Database
30
AGENDA
31
Presentation
Process
Domain
Domain objects / Entities Factories / Repositories Enums / Value objects / Smart references [Mapping]
Data / Services
Outside world
Database
33
Why?
Create traceability Facilitate reuse Implement model view controller Facilitate easier functional testing Cheapen application maintenance
34
35
TASK PATTERN
Command pattern Definition
Encapsulate a request as an object, thereby letting you parameterize clients with different requests, queue or log requests, and support undoable operations
In practice
Implement smart use cases independently Define a navigation mechanism Use smart use cases independently Allows for reuse of your smart use cases!
Useful when
Always Create a task manager!
36
TASK PATTERN
37
38
39
TASK PATTERN
40
41
42
43
44
45
46
47
MANAGER-PROVIDER PATTERN
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
49
MANAGER VALIDATIONMANAGER
50
INTERFACE
51
52
CONFIGURATION OF IMPLEMENTATION
53
54
55
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!
56
AGENDA
57
Existing Applications
Software Architecture
Use cases
Business models
59
Templates
Templates contains code that runs in template engine Templates might use a folder model
Generation process
Ability to generate all or individual UML model elements Which UML model elements are supported? Generated deliverables can be code but also any other document type
60
Properties can be used in templates Template engine knows (part of) the UML meta model
61
62
63
GENERATING CODE
A quick example
incl ude
master detail Manage Customer Site Administrator (from A ctors) extend define Define Contact
65
66
67
68
69
AGENDA
70
Presentation
Process
Domain
Domain objects / Entities Factories / Repositories Enums / Value objects / Smart references [Mapping]
Data / Services
Outside world
Database
72
How?
Create unit test for each smart use case Run methods from smart use case Validate outcome (using asserts)
Why?
Great code coverage Regressions testing on smart use cases Code generation makes light work
73
Run method
Validate outcome
74
75
Task management
(Possibly) avoid other task getting started
View management
Dont request actual web pages or forms Method calls from web pages are tested
Domain
Handle actual validation, saves, removes Make sure business rules validate
Validation
Validate, but handle by logging
77
78
79
80
81
Test methods that interact with domain Set up (in)valid domain object
Validate outcome
82
TAKEAWAYS
TAKEAWAYS
Smart use cases
Solid unit of work in agile projects Easy estimation Identifying functional re-use early in projects Guarantee front-to-back traceability Great unit for (automated) testing Apply stereotypes for even more standardization Use a REAL modeling tool
Software architecture
Provide separate smart use cases layer Handles process, interaction and work flow Controller ++
84
TAKEAWAYS
Coding
Implement task pattern Implement task management Modeling provides for model driven development
Testing
Smart use cases allow for automated testing Great code coverage on all layers Mock actual task environment Run tests automated in nightly builds
85
WWW.SMARTUSECASE.COM
www.accelerateddeliveryplatform.com