Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP...

30
Internetprogrammer Internetprogrammer en en Projectwerk: Projectwerk: Supermarktapplicat Supermarktapplicat ie ie XVIII The development XVIII The development process: process: Adapted RUP (ARUP) Adapted RUP (ARUP)

Transcript of Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP...

Page 1: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

InternetprogrammInternetprogrammereneren

Projectwerk: Projectwerk: SupermarktapplicaSupermarktapplica

tie tie XVIII The development XVIII The development process:process:

Adapted RUP (ARUP)Adapted RUP (ARUP)

Page 2: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

2IX The Process: Adapted RUP

Why adapt RUP ?Why adapt RUP ?=The decision to use a RUP-dialect instead of =The decision to use a RUP-dialect instead of

plain RUP follows from these observations:plain RUP follows from these observations: There are two related processes competing There are two related processes competing

for attention RUP and XP:for attention RUP and XP: RUP: Rational Unified Process (see article !)RUP: Rational Unified Process (see article !)

Originally called Objectory and Rational Objectory Originally called Objectory and Rational Objectory ProcessProcess

From the designers of UML, From the designers of UML, Booch, Jacobson & Booch, Jacobson & RumbaughRumbaugh

previously by owned by previously by owned by RationalRational, now owned by , now owned by IBMIBM, , eXtreme Programming (see article)eXtreme Programming (see article)

From From Kent BeckKent Beck

Page 3: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

3IX The Process: Adapted RUP

Why adapt RUP ?Why adapt RUP ?

XP may not be suited for us:XP may not be suited for us: XP seems XP seems a bit vague about what should a bit vague about what should

happen prior to writing the first testhappen prior to writing the first test case case and writing the tested code. For the less and writing the tested code. For the less experienced of us, it may be a good idea to experienced of us, it may be a good idea to be be forcedforced to make at least a sketch of a to make at least a sketch of a domain model, prior to coding. Granted, XP domain model, prior to coding. Granted, XP tells you, you should do all classic phases tells you, you should do all classic phases (Requirements, Analysis, Design, Testing) in (Requirements, Analysis, Design, Testing) in every iteration. It is vague about what this every iteration. It is vague about what this Analysis & Design might be.Analysis & Design might be.

Page 4: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

4IX The Process: Adapted RUP

Why adapt RUP ?Why adapt RUP ?

RUP may not be suited for us either:RUP may not be suited for us either: It is simply It is simply too heavytoo heavy, talks about too , talks about too

many models, and would take ages, just many models, and would take ages, just to learn what it is, let alone learn how to learn what it is, let alone learn how to use it.to use it.

Page 5: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

5IX The Process: Adapted RUP

What you will read about What you will read about RUP & XPRUP & XP

You will read:You will read: XP is suitable, if both of the following XP is suitable, if both of the following

conditions are true:conditions are true: You have a small team (2-12)You have a small team (2-12) Requirements are vague (users don’t know yet Requirements are vague (users don’t know yet

what they want)what they want) RUP is suitable if one of the previous RUP is suitable if one of the previous

conditions are false.conditions are false.

When using XP with large teams, the When using XP with large teams, the general (unspoken) idea that everyone general (unspoken) idea that everyone needs to know everyone elses code details, needs to know everyone elses code details, becomes hard to defend, especially when becomes hard to defend, especially when requirements/specifications are clear.requirements/specifications are clear.

Page 6: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

6IX The Process: Adapted RUP

Adapted RUP: general Adapted RUP: general ideaidea

Use RUP skeletonUse RUP skeleton Remove less usefull techniques and diagramsRemove less usefull techniques and diagrams Replace construction phase with XPReplace construction phase with XP(no big deal: both are based on use cases and automated (no big deal: both are based on use cases and automated

testing)testing) Add what I call ‘Robert C. Martin heuristics’ to Add what I call ‘Robert C. Martin heuristics’ to

help the design: help the design: -> uses case -> uses case

-> collaboration diagram-> collaboration diagram

-> class diagram -> class diagram

-> improved class diagram (improved -> improved class diagram (improved design)design)

Page 7: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

7IX The Process: Adapted RUP

AARUPRUP

The text is based on Chapter 2 from UML Distilled (Martin The text is based on Chapter 2 from UML Distilled (Martin Fowler, first edition 1997). The name RUP didn’t exist yet. Fowler, first edition 1997). The name RUP didn’t exist yet. It was called ‘The Rational Objectory Process’ at the time It was called ‘The Rational Objectory Process’ at the time and it was still under construction. The chapter tried to and it was still under construction. The chapter tried to summarize what ROP would become and it is without summarize what ROP would become and it is without doubt, influenced by Fowlers own ideas.doubt, influenced by Fowlers own ideas.

I will indicate whenever I add:I will indicate whenever I add: a personal comment (PC)a personal comment (PC) XP-elements (XP)XP-elements (XP) Robert C. Martin’s techniquesRobert C. Martin’s techniques Martin Fowler’s adviceMartin Fowler’s advice

Page 8: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

8IX The Process: Adapted RUP

Overview of the Software Overview of the Software Development ProcessDevelopment Process

1 2 3 …

Inception Elaboration Construction Transition

iterations

Page 9: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

9IX The Process: Adapted RUP

InceptionInception

Takes a few days.Takes a few days. Look at costs & gains.Look at costs & gains. Project scope & size (maybe do some Project scope & size (maybe do some

analysis).analysis). Sponsor may not have agreed yet.Sponsor may not have agreed yet.

Page 10: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

10IX The Process: Adapted RUP

ElaborationElaboration

Takes one fifth of total length of the Takes one fifth of total length of the project.project.

Sponsor agreesSponsor agrees Only vague requirements -> Need better Only vague requirements -> Need better

understanding of the problem:understanding of the problem: Build what ?Build what ? Build how ?Build how ? Use what technology ?Use what technology ?

The answers depend on the The answers depend on the risksrisks in the in the project:project:

Page 11: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

11IX The Process: Adapted RUP

Elaboration: look at risksElaboration: look at risks Requirements risksRequirements risks

=danger of building the wrong system=danger of building the wrong system -> Need to know requirements and its priorities-> Need to know requirements and its priorities UML technique to use: UML technique to use:

use cases. It is a UML diagram type, but text will do use cases. It is a UML diagram type, but text will do fine.fine.

conceptual class diagram (a skeleton is fine) conceptual class diagram (a skeleton is fine) ‘=domain ‘=domain model’model’

Technological risksTechnological risks =danger of using technology that doesn’t work=danger of using technology that doesn’t work E.g. you are going to use an OODB you hardly know : E.g. you are going to use an OODB you hardly know :

Ever tried it out ? (PC)Ever tried it out ? (PC) UML techniques to use:UML techniques to use:

Class diagramClass diagram Package diagram (dependencies between packages)Package diagram (dependencies between packages) Deployment diagrams (big picture of used technologies)Deployment diagrams (big picture of used technologies)

Page 12: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

12IX The Process: Adapted RUP

Elaboration: look at risks Elaboration: look at risks (continued)(continued)

Skills riskSkills risk Political riskPolitical risk

=danger that management will force =danger that management will force awkward decisions. You awkward decisions. You mustmust workt workt together with this consulting firm whose together with this consulting firm whose boss I play golf with (PC)boss I play golf with (PC)

Page 13: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

13IX The Process: Adapted RUP

Elaboration: Baseline Elaboration: Baseline ArchitectureArchitecture

Baseline Architecture consists of:Baseline Architecture consists of: list oflist of use casesuse cases which tell you what which tell you what

the requirements are. These are a the requirements are. These are a starting point for planning.starting point for planning.

a a domain modeldomain model To capture business understandingTo capture business understanding Serves as starting point for domain classesServes as starting point for domain classes

techology platformtechology platform

Page 14: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

14IX The Process: Adapted RUP

Elaboration: PlanningElaboration: Planning

Planning:Planning:Planning is finished when you have:Planning is finished when you have:

Assigned use cases to iterationsAssigned use cases to iterations Assigned start dates to iterationsAssigned start dates to iterations

How does it work: How does it work: 1.1. Categorize use cases: Categorize use cases:

UsersUsers assign a priority level to each use case. assign a priority level to each use case. DevelopersDevelopers assign a priority level to each use case assign a priority level to each use case

based on based on architectural riskarchitectural risk (design). (design). DevelopersDevelopers assess their confidence in the time it assess their confidence in the time it

takes to build the use cases. (takes to build the use cases. (schedule riskschedule risk))

Page 15: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

15IX The Process: Adapted RUP

Elaboration: PlanningElaboration: Planning

2.2. Determine iteration length (2 to 8 Determine iteration length (2 to 8 weeks):weeks): Try and keep a fixed length for each Try and keep a fixed length for each

iteration.iteration. 3. Assign use cases to iterations:3. Assign use cases to iterations:

Do not postpone high-risk use cases to the Do not postpone high-risk use cases to the endend

Page 16: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

16IX The Process: Adapted RUP

ConstructionConstruction Construction is done in iterationsConstruction is done in iterations Each iteration takes 2 to 8 weeksEach iteration takes 2 to 8 weeks Each iteration has several use casesEach iteration has several use cases Each iteration is a mini-project in which you do Each iteration is a mini-project in which you do

analysis, design, coding, testing and analysis, design, coding, testing and integration.integration.

The reason for doing iterations is to reduce The reason for doing iterations is to reduce risk.risk.

Iterations areIterations are IncrementalIncremental in functionin function: each iteration, you add : each iteration, you add

new functionalitynew functionality Iterative in terms of the code baseIterative in terms of the code base: each : each

iteration, you will need to rewrite (iteration, you will need to rewrite (refactorrefactor) exsiting ) exsiting code !!!code !!!

Page 17: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

17IX The Process: Adapted RUP

Construction: testingConstruction: testing Some remarks about testing:Some remarks about testing:

Write as much test code as production code (Kent Write as much test code as production code (Kent Beck & Martin Fowler)Beck & Martin Fowler)

Before writing code you should know how to test itBefore writing code you should know how to test it XP: first write the test.XP: first write the test.

Test code should be kept and run foreverTest code should be kept and run forever Test code should either say OK or give a list of Test code should either say OK or give a list of

failuresfailures Split tests up intoSplit tests up into

Unit tests: written by developers, organized on package Unit tests: written by developers, organized on package basis, test all class interfaces basis, test all class interfaces (=public methods ? PC)(=public methods ? PC)

System tests: black box tests, written by specialized testersSystem tests: black box tests, written by specialized testers Integration: full integration at the end of each Integration: full integration at the end of each

iteration:iteration: XP: do full integration testing, much, much more XP: do full integration testing, much, much more

frequently than that.frequently than that.

Page 18: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

18IX The Process: Adapted RUP

Construction: refactoringConstruction: refactoring Software entropy and refactoring:Software entropy and refactoring:

Entropy = the fact that in nature, structure and Entropy = the fact that in nature, structure and order often gradually disintegrate into chaos. order often gradually disintegrate into chaos. The same thing can happen to software, after The same thing can happen to software, after years of adding functionality.years of adding functionality.

When adding functionality, you should also When adding functionality, you should also redesign (refactor) the existing code. Fowler: redesign (refactor) the existing code. Fowler: ‘Scheduling pressure being what it is, most ‘Scheduling pressure being what it is, most people prefer to put their pain off to the future’people prefer to put their pain off to the future’

Fighting entropy: Fighting entropy: refactoringrefactoring. Some . Some Principles:Principles:

Do not refactor and add functionality at same timeDo not refactor and add functionality at same time Always provide good testsAlways provide good tests Take short stepsTake short steps

Page 19: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

19IX The Process: Adapted RUP

Construction: using the Construction: using the UMLUML

You already have a conceptual level class You already have a conceptual level class diagram from the Elaboration phasediagram from the Elaboration phase

For the day to day work,For the day to day work, I suggestI suggest (PC) you (PC) you use Robert C. Martins techniques:use Robert C. Martins techniques:

-> uses case (but use just text)-> uses case (but use just text)-> collaboration diagram-> collaboration diagram

-> class diagram -> class diagram -> improved class diagram (improved -> improved class diagram (improved

design)design) Documentation (Martin Fowler):Documentation (Martin Fowler):

Class diagramClass diagram Interaction diagrams (e.g. collaboration diagrams)Interaction diagrams (e.g. collaboration diagrams) Some text to pull the diagrams togetherSome text to pull the diagrams together

Page 20: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

20IX The Process: Adapted RUP

Construction: Remark Construction: Remark about databasesabout databases

Traditionally, the OO community Traditionally, the OO community more or less ignores database more or less ignores database issues. Simply stating that your issues. Simply stating that your business model should be business model should be independent of your data-model is independent of your data-model is not enough.not enough.

So, I strongly suggest , that you also So, I strongly suggest , that you also create normalized relational create normalized relational database design models (PC). database design models (PC).

Page 21: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

21IX The Process: Adapted RUP

TransitionTransition

Is the last phaseIs the last phase Typically between beta release and Typically between beta release and

final release.final release. A thing to postpone to this phase is A thing to postpone to this phase is

optimization.optimization.

Why ? Optimization reduces clarity Why ? Optimization reduces clarity and extensibility: and extensibility: e.g. cashing inside e.g. cashing inside functions, duplicating code to avoid functions, duplicating code to avoid procedure call time penalty (PC)procedure call time penalty (PC)

Page 22: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

22IX The Process: Adapted RUP

Project assignments: Project assignments: RemarksRemarks

More diagrams than really neededMore diagrams than really needed You will create more diagrams than You will create more diagrams than

you normally would have to. you normally would have to. More case-tools than really neededMore case-tools than really needed

You will also draw more diagrams with You will also draw more diagrams with toolstools than you would normally do. This than you would normally do. This is because I have to assess your ability is because I have to assess your ability to draw diagrams and your ability to to draw diagrams and your ability to learn and use tools.learn and use tools.

Page 23: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

23IX The Process: Adapted RUP

About Tools…About Tools…

Many views about tools exist:Many views about tools exist: Some say: (KULeuven Karel de Some say: (KULeuven Karel de

Vlaminck) Vlaminck) Create all models, exhaustive & detailed, Create all models, exhaustive & detailed,

preferabley in iterations. (class, sequence, preferabley in iterations. (class, sequence, … everything)… everything)

Either generate codeEither generate codefrom the modelsfrom the models Or handcode using the models as a blueprint. Or handcode using the models as a blueprint.

Carefully Keep model and code up to date.Carefully Keep model and code up to date.

For them, tools are very important. The For them, tools are very important. The application is created application is created withwith the tool. the tool.

Page 24: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

24IX The Process: Adapted RUP

About Tools…About Tools…

Others say: (Robert C. Martin)Others say: (Robert C. Martin) Create some modelsCreate some models

On the whiteboard, or with pencil & paper, just On the whiteboard, or with pencil & paper, just to communicate to communicate

When the team leaves (documentation, only high When the team leaves (documentation, only high level)level)

Let your code express the design: make Let your code express the design: make both high level and lower level codeboth high level and lower level code

For them, tools are just cosmetics. The For them, tools are just cosmetics. The diagrams just look nicer when printed diagrams just look nicer when printed than wen drawn with a pencil.than wen drawn with a pencil.

Page 25: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

25IX The Process: Adapted RUP

OO Modeling ToolsOO Modeling ToolsLinks (right-click Open Links (right-click Open HyperLink)HyperLink)

List of links to many download List of links to many download sites with OO modeling softwaresites with OO modeling software www.objectsbydesign.com/tools/umltoolwww.objectsbydesign.com/tools/umltools_byCompany.htmls_byCompany.html

Note: For most free modeling tools, Note: For most free modeling tools, you will need to download the you will need to download the latest version of the Java Runtime latest version of the Java Runtime Environment. If you download JUST Environment. If you download JUST THAT, this takes only a minute or THAT, this takes only a minute or so.so.

Page 26: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

26IX The Process: Adapted RUP

An OO case-tool case study: An OO case-tool case study:

Argo UML: Class DiagramArgo UML: Class Diagram

Page 27: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

27IX The Process: Adapted RUP

Argo UML: RemarksArgo UML: Remarks

Class Diagram Remarks:Class Diagram Remarks: Easy to learnEasy to learn Code generation oriented: therefor:Code generation oriented: therefor:

Not possible: difference between conceptual, Not possible: difference between conceptual, specification, implementationspecification, implementation

Not possible: not specifiying attribute typesNot possible: not specifiying attribute types Not possible: NOT SPECIFIED navigatabilityNot possible: NOT SPECIFIED navigatability

I have to specify BIDIRECTIONAL to get rid of I have to specify BIDIRECTIONAL to get rid of the navigatabilitiesthe navigatabilities

default property and association visibility is default property and association visibility is public !public !

Page 28: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

28IX The Process: Adapted RUP

A Database modeling Tool A Database modeling Tool case study: Charonware case study: Charonware

Case studioCase studio Charonware Case studio 2.15 lt. (30 Charonware Case studio 2.15 lt. (30

days 6 entities)days 6 entities)

http://www.casestudio.com/enu/http://www.casestudio.com/enu/ddocument.aspxddocument.aspx

Page 29: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

29IX The Process: Adapted RUP

Charonware Case Studio: Charonware Case Studio: RemarksRemarks

ER Diagram Remarks:ER Diagram Remarks: +Easy to learn+Easy to learn +Supports different levels +Supports different levels

High Level: no types, no (null/not null) )High Level: no types, no (null/not null) ) Physical Level: types, null/not null Physical Level: types, null/not null

-No support for generalization. (Some -No support for generalization. (Some ER modeling techniques do allow it)ER modeling techniques do allow it) You have to fake it.You have to fake it.

Page 30: Internetprogrammeren Projectwerk: Supermarktapplicatie XVIII The development process: Adapted RUP (ARUP)

30IX The Process: Adapted RUP

Charonware Case Studio: Charonware Case Studio: ER diagramER diagram