Sander Hoogendoorn
Principal Technology Officer
Capgemini
HOW SMART USE CASES DRIVE WEB DEVELOPMENT
2HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Capgemini
Principal technology officer
Glo...
3HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
AGENDA
Comparing requirements
techniques
M...
4HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
AGENDA
Comparing requirements
techniques
M...
User stories, huge cases and smart use cases
REQUIREMENT TECHNIQUES COMPARED
6HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
USER STORIES – APPLES AND PEARS
Often too ...
7HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
COMPLEX IT LANDSCAPES
8HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
HUGE CASES Hard to build,
impossible to te...
9HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
DIFFERENT LEVELS OF USE CASES
Cloud level
...
10HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
DIFFERENT LEVELS OF USE CASES
11HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Traditional
use cases
Smart
use cases
For...
12HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
AGENDA
Comparing requirements
techniques
...
A YAGNI approach to requirements
SMART USE CASES
14HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
In traditional software development
Analy...
15HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
AGILE REQUIREMENTS - APPROACH
D
E
F
Smart...
16HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
CLOUD LEVEL
17HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
KITE LEVEL
18HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Guidelines
Identify re-use
Model one form...
19HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
MODELING SMART USE CASES
20HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
MODELING SMART USE CASES – SEA AND FISH L...
21HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
DESCRIBING USE CASES – SEA AND FISH LEVEL
Stereotypes
SMART USE CASES
23HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Stereotypes in UML
Marking model items gi...
24HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
AGENDA
Comparing requirements
techniques
...
An overview
SMART USE CASE DRIVEN ARCHITECTURE
26HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Database consumer
Domain oriented
Data pr...
27HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Presentation
Process
Domain
Data / Servic...
28HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Exact SAP BizTalk Java
Presentation
Proce...
29HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Presentation
Process
Domain
Data / Servic...
30HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
ARCHITECTURE IN CODE
Web
Pages, controls
...
31HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
AGENDA
Comparing requirements
techniques
...
Introducing the Task Pattern
SMART USE CASE DRIVEN ARCHITECTURE
33HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Presentation
Process
Domain
Data / Servic...
34HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Smart use cases
Act as primary unit of wo...
35HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
SMART USE CASES IN CODE
36HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Command pattern – Definition
Encapsulate ...
37HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN
38HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN IN PRACTICE
39HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN IN PRACTICE – RUNNING A USE ...
40HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN
41HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN – START FIRST USE CASE
42HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN – START SECOND USE CASE
43HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN – WEB PAGE WITH SECOND USE C...
44HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN – POST CONDITIONS SECOND USE...
45HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN – CONTINUE FIRST USE CASE
46HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN – WEB PAGE WITH FIRST USE CA...
47HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TASK PATTERN – POST CONDITIONS FIRST USE ...
Task management with the Manager-Provider Pattern
SMART USE CASE DRIVEN ARCHITECTURE
49HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Definition
Create a simple static facade ...
50HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
MANAGER – VALIDATIONMANAGER
51HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
INTERFACE
52HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
MANAGER – INITIALIZATION (USING DEPENDENC...
53HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
CONFIGURATION OF IMPLEMENTATION
54HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
MANAGER - EXECUTING METHODS
55HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
CLIENT – CALLING METHODS
56HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Useful when
Generic services need to be c...
57HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
AGENDA
Comparing requirements
techniques
...
An introduction to pragmatic model driven development
GENERATING CODE FROM SMART USE CASES
59HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Forms
Use cases
Domain
objects
Data / Ser...
60HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Characteristics
Load UML model (expressed...
61HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
MODEL DRIVEN DEVELOPMENT - TEMPLATE ENGIN...
62HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
MODEL DRIVEN DEVELOPMENT - TEMPLATES
63HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
GENERATE MANY THINGS E.G. TABLE CREATE SC...
A quick example
GENERATING CODE
65HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
A SIMPLE SMART USE CASE MODEL
uc Manage C...
66HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
A SIMPLE DOMAIN MODEL
class Budapest.Busi...
67HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
USING TOBAGO MDA
68HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
GENERATED CODE IN ASP.NET
69HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
GENERATED CODE IN SILVERLIGHT
70HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
AGENDA
Comparing requirements
techniques
...
Unit testing at the right level
UNIT TESTING SMART USE CASES
72HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Presentation
Process
Domain
Data / Servic...
73HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
UNIT TESTING SMART USE CASES
Unit test wh...
74HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
UNIT TESTING SMART USE CASES
Test methods...
75HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
UNIT TESTING SMART USE CASES
Test methods...
Introducing a light weight smart use case unit testing framework
UNIT TESTING SMART USE CASES
77HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Test environment
Create test manager (usi...
78HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
CONFIGURING TEST ENVIRONMENT
79HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TEST MANAGER – LOGGING EVENTS
80HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
MOCKING ENVIRONMENT – LOGGING EVENTS
81HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TEST MANAGER – QUERYING EVENTS
82HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
TEST MANAGER – RUNNING TESTS
Test methods...
TAKEAWAYS
84HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Smart use cases
Solid unit of work in agi...
85HOW SMART USE CASES DRIVE WEB DEVELOPMENT
©2010 Capgemini. All Rights Reserved
Coding
Implement task pattern
Implement t...
www.accelerateddeliveryplatform.com
WWW.SMARTUSECASE.COM
sander.hoogendoorn@capgemini.com
www.sanderhoogendoorn.com
www.smartusecase.com
@aahoogendoorn
REFERENCES AND QUESTIONS
Upcoming SlideShare
Loading in …5
×

20101007 how smart use cases drive web development

5,975 views

Published on

Use cases have been around for many years describing the requirements of software development projects. From a developer’s point of view, use cases are often seen as too abstract and too complex to develop code from. Until now, that is.

During this interactive talk, presented by speaker Sander Hoogendoorn at Microsoft TechEd Europe 2010 in Berlin, will demonstrate how to model, generate and build smart use cases. This great technique allows you to model use cases at a much more pragmatic, low-granular level, enabling them to be implemented simply and directly into applications such as ASP.NET or Silverlight. Using many real-life code examples, the speaker will introduce both the positive impact that smart use cases have on your layered software architecture, as well as the design patterns required to implement them.

Published in: Technology, Business
0 Comments
6 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
5,975
On SlideShare
0
From Embeds
0
Number of Embeds
2,959
Actions
Shares
0
Downloads
128
Comments
0
Likes
6
Embeds 0
No embeds

No notes for slide

20101007 how smart use cases drive web development

  1. 1. Sander Hoogendoorn Principal Technology Officer Capgemini HOW SMART USE CASES DRIVE WEB DEVELOPMENT
  2. 2. 2HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved 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 SANDER HOOGENDOORN
  3. 3. 3HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved AGENDA Comparing requirements techniques Modeling smart use cases Smart use case driven software architecture Introducing the task pattern Generating code from smart use cases Unit testing smart use cases
  4. 4. 4HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved AGENDA Comparing requirements techniques Modeling smart use cases Smart use case driven software architecture Introducing the task pattern Generating code from smart use cases Unit testing smart use cases
  5. 5. User stories, huge cases and smart use cases REQUIREMENT TECHNIQUES COMPARED
  6. 6. 6HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved USER STORIES – APPLES AND PEARS Often too unstructured Unsuitable in complex environments
  7. 7. 7HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved COMPLEX IT LANDSCAPES
  8. 8. 8HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved HUGE CASES Hard to build, impossible to test
  9. 9. 9HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved DIFFERENT LEVELS OF USE CASES Cloud level Kite level Sea level Fish level Clam level High summary Summary User goal Sub-function Too low Products Selling products Search book Insert orderline Sell book
  10. 10. 10HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved DIFFERENT LEVELS OF USE CASES
  11. 11. 11HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved Traditional use cases Smart use cases Format Textual Visual Granularity Different Unified Estimate Hard Easy Unit of work Lousy Good Reuse Incidental Normal Traceability Possible Normal Testability Poor Good Traditional use cases Only user goal level use cases Use cases ‘as they are intended’ A single use case describes a single elementary business process Differ in granularity too much Law of Large Numbers does not apply Smart use cases User goal and sub function level use cases Good unit of work and estimation A single elementary business process is modeled in a single use case diagram A single user goal level use case + auxiliary use cases at sub-function level Very similar granularity DIFFERENT LEVELS OF USE CASES
  12. 12. 12HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved AGENDA Comparing requirements techniques Modeling smart use cases Smart use case driven software architecture Introducing the task pattern Generating code from smart use cases Unit testing smart use cases
  13. 13. A YAGNI approach to requirements SMART USE CASES
  14. 14. 14HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved In traditional software development Analysis and design is done upfront Development only starts after all design is complete and perfect 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 YAGNI. YOU AIN’T GONNA NEED IT
  15. 15. 15HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved AGILE REQUIREMENTS - APPROACH D E F Smart Use Cases A Project Scope D Use Cases A B C Hierarchical Processes B D D Hierarchical Processes Chronological Processes Cloud Level Kite Level Sea Level Fish Level C
  16. 16. 16HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved CLOUD LEVEL
  17. 17. 17HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved KITE LEVEL
  18. 18. 18HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved Guidelines Identify re-use Model one form per use case Model one use case per web part Isolate unknown or complex functionality Model complex calculations Identify reports and analysis Isolate interaction with others Model services in service orientation Avoid low level interaction (database, technical services) IDENTIFYING SUB-FUNCTION LEVEL USE CASES
  19. 19. 19HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved MODELING SMART USE CASES
  20. 20. 20HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved MODELING SMART USE CASES – SEA AND FISH LEVEL
  21. 21. 21HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved DESCRIBING USE CASES – SEA AND FISH LEVEL
  22. 22. Stereotypes SMART USE CASES
  23. 23. 23HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved Stereotypes in UML Marking model items gives explicit meaning to the model Predefined stereotypes Custom definable stereotypes Smart use case stereotypes Standardize analysis and design “This is a master-detail on product and order” “This service on customer is an aggregate” “We need a file import for handling the XMI” Facilitate easy estimation Commoditize realization of smart use case Facilitate easier (and automated) testing SMART USE CASE STEREOTYPES
  24. 24. 24HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved AGENDA Comparing requirements techniques Modeling smart use cases Smart use case driven software architecture Introducing the task pattern Generating code from smart use cases Unit testing smart use cases
  25. 25. An overview SMART USE CASE DRIVEN ARCHITECTURE
  26. 26. 26HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved Database consumer Domain oriented Data provided by database(s) But often database independent 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 USING REFERENCE ARCHITECTURES
  27. 27. 27HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©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] Table Gateways Queries [Mapping] Database
  28. 28. 28HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved Exact SAP BizTalk Java 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] Services / ESB
  29. 29. 29HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved Presentation Process Domain Data / Services Outside world Service contracts Operation contracts Data contracts Use cases Services Domain objects / Entities Factories / Repositories Enums / Value objects / Smart references [Mapping] Table Gateways / Service Gateways Queries / Service Locators [Mapping] Database Services / ESB Exact SAP BizTalk Java
  30. 30. 30HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved 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
  31. 31. 31HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved AGENDA Comparing requirements techniques Modeling smart use cases Smart use case driven software architecture Introducing the task pattern Generating code from smart use cases Unit testing smart use cases
  32. 32. Introducing the Task Pattern SMART USE CASE DRIVEN ARCHITECTURE
  33. 33. 33HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©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] Table Gateways Queries [Mapping] Database
  34. 34. 34HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved Smart use cases Act as primary unit of work Model process and work flow Make traceable in code Interact with presentation and domain layers Create layer supertype (task) Create classes for individual smart use cases Why? Create traceability Facilitate reuse Implement model view controller Facilitate easier functional testing Cheapen application maintenance SMART USE CASES IN CODE
  35. 35. 35HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved SMART USE CASES IN CODE
  36. 36. 36HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved 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 Task pattern – Definition Encapsulate a smart use case as an object, thereby letting you parameterize it from different requests. 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! TASK PATTERN
  37. 37. 37HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN
  38. 38. 38HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN IN PRACTICE
  39. 39. 39HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN IN PRACTICE – RUNNING A USE CASE
  40. 40. 40HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN
  41. 41. 41HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN – START FIRST USE CASE
  42. 42. 42HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN – START SECOND USE CASE
  43. 43. 43HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN – WEB PAGE WITH SECOND USE CASE
  44. 44. 44HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN – POST CONDITIONS SECOND USE CASE
  45. 45. 45HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN – CONTINUE FIRST USE CASE
  46. 46. 46HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN – WEB PAGE WITH FIRST USE CASE
  47. 47. 47HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TASK PATTERN – POST CONDITIONS FIRST USE CASE
  48. 48. Task management with the Manager-Provider Pattern SMART USE CASE DRIVEN ARCHITECTURE
  49. 49. 49HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©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
  50. 50. 50HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved MANAGER – VALIDATIONMANAGER
  51. 51. 51HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved INTERFACE
  52. 52. 52HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved MANAGER – INITIALIZATION (USING DEPENDENCY INJECTION)
  53. 53. 53HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved CONFIGURATION OF IMPLEMENTATION
  54. 54. 54HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved MANAGER - EXECUTING METHODS
  55. 55. 55HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved CLIENT – CALLING METHODS
  56. 56. 56HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©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
  57. 57. 57HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved AGENDA Comparing requirements techniques Modeling smart use cases Smart use case driven software architecture Introducing the task pattern Generating code from smart use cases Unit testing smart use cases
  58. 58. An introduction to pragmatic model driven development GENERATING CODE FROM SMART USE CASES
  59. 59. 59HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved Forms Use cases Domain objects Data / Service classes Databases Software Architecture Tobago MDA Test scenario’s Frameworks Specifications Existing Applications Business models Domain Model Smart use cases User interface specification 1. Map your business processes to smart use cases 1. Map your business processes to smart use cases 2. Set up your domain model 2. Set up your domain model 3. Establish your software architecture(s) 3. Establish your software architecture(s) 4. Generate your code using a text template engine 4. Generate your code using a text template engine 5. Finalize your application 5. Finalize your application
  60. 60. 60HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved Characteristics Load UML model (expressed in XMI) Load templates (from flat files) Combine elements from UML model with templates to generate deliverables 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 MODEL DRIVEN DEVELOPMENT – TEMPLATE ENGINES
  61. 61. 61HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved MODEL DRIVEN DEVELOPMENT - TEMPLATE ENGINES Template engine knows (part of) the UML meta model Template engine knows (part of) the UML meta model Properties can be used in templates Properties can be used in templates
  62. 62. 62HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved MODEL DRIVEN DEVELOPMENT - TEMPLATES
  63. 63. 63HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved GENERATE MANY THINGS E.G. TABLE CREATE SCRIPTS
  64. 64. A quick example GENERATING CODE
  65. 65. 65HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved A SIMPLE SMART USE CASE MODEL uc Manage Customer Site Administrator (from Actors) «master detail» Manage Customer «search» Select Customer «define» Define Contact «extend» «include»
  66. 66. 66HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved A SIMPLE DOMAIN MODEL class Budapest.Business «business class» Customer + Name: string + Address: string + Postcode: Postcode + City: string + Country: SmartRef + Website: Url [0..1] «business class» Contact + Name: string + Email: Email [0..1] + Phone: PhoneNumber [0..1] + Department: Departments «enumeration» Departments Sales Purchasing Helpdesk Management *
  67. 67. 67HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved USING TOBAGO MDA
  68. 68. 68HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved GENERATED CODE IN ASP.NET
  69. 69. 69HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved GENERATED CODE IN SILVERLIGHT
  70. 70. 70HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved AGENDA Comparing requirements techniques Modeling smart use cases Smart use case driven software architecture Introducing the task pattern Generating code from smart use cases Unit testing smart use cases
  71. 71. Unit testing at the right level UNIT TESTING SMART USE CASES
  72. 72. 72HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©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] Table Gateways Queries [Mapping] Database
  73. 73. 73HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved UNIT TESTING SMART USE CASES Unit test what? Methods from the task pattern Methods that are called from presentation Methods that collaborate with other use cases Methods that interact with domain 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
  74. 74. 74HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved UNIT TESTING SMART USE CASES Test methods from Task Pattern Run method Validate outcome
  75. 75. 75HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved UNIT TESTING SMART USE CASES Test methods that interact with domain Set up (in)valid domain object Run method from use case Validate outcome
  76. 76. Introducing a light weight smart use case unit testing framework UNIT TESTING SMART USE CASES
  77. 77. 77HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved Test environment Create test manager (using manager-provider) Mock actual use case environment Log events from environment to test manager Asserts by querying test manager Task management (Possibly) avoid other task getting started View management Don’t 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 A LIGHTWEIGHT SMART USE CASE UNIT TESTING FRAMEWORK
  78. 78. 78HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved CONFIGURING TEST ENVIRONMENT
  79. 79. 79HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TEST MANAGER – LOGGING EVENTS
  80. 80. 80HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved MOCKING ENVIRONMENT – LOGGING EVENTS
  81. 81. 81HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TEST MANAGER – QUERYING EVENTS
  82. 82. 82HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved TEST MANAGER – RUNNING TESTS Test methods that interact with domain Set up (in)valid domain object Run method from use case Validate outcome
  83. 83. TAKEAWAYS
  84. 84. 84HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved 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 ++ TAKEAWAYS
  85. 85. 85HOW SMART USE CASES DRIVE WEB DEVELOPMENT ©2010 Capgemini. All Rights Reserved 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 TAKEAWAYS
  86. 86. www.accelerateddeliveryplatform.com WWW.SMARTUSECASE.COM
  87. 87. sander.hoogendoorn@capgemini.com www.sanderhoogendoorn.com www.smartusecase.com @aahoogendoorn REFERENCES AND QUESTIONS

×