Presentation is loading. Please wait.

Presentation is loading. Please wait.

IN 265 Problemformulering,.. Forelesning 18.3.2003 Arild Jansen Ifi 1 Systems grenser mot omverdenen Forelesning IN 265 18.3-2003 Are Use Cases necessarily.

Similar presentations


Presentation on theme: "IN 265 Problemformulering,.. Forelesning 18.3.2003 Arild Jansen Ifi 1 Systems grenser mot omverdenen Forelesning IN 265 18.3-2003 Are Use Cases necessarily."— Presentation transcript:

1 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 1 Systems grenser mot omverdenen Forelesning IN Are Use Cases necessarily the best start of an OO System Development Process? Basert på artikkel og lysark av Gerhard Skagestein, Universitetet i Oslo

2 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 2 The Unified Modeling Language - UML A set of 8 diagram techniques, established by groups setting the tone within the OO community Use- Case view Logi- cal view Compo- nent view Concur- rency view Deploy- ment view Use-Case diagram Class/object diagram Sequence diagram Collaboration diagram State diagram Activity diagram Component diagram Deployment diagram

3 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 3 Recommended sequence by most methods Start here Use- Case view Logi- cal view Compo- nent view Concur- rency view Deploy- ment view Use-Case diagram Class/object diagram Sequence diagram Collaboration diagram State diagram Activity diagram Component diagram Deployment diagram

4 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 4 A Use Case for an Automatic Teller Machine (see IN 102, ch. 9) Automatic Teller Machine Show recent transactions Show currency exchange rates Withdraw cash Customer Insert card Give PIN Select amount Remove card Take money

5 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 5 Whats nice with Use Cases lDescribe the expected functionality of the system on an appropriate abstraction level lNice form of requirement specifications lExcellent basis for test-programs lUnderstandable by the users

6 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 6 What is bad with Use Cases lUse Cases are build on assumptions about the boundary of the system to be used lResponsibilities of users and system are more or less taken for granted lDoes not assist in getting new ideas on how to organise things better – on the contrary, they prevent you from getting such ideas

7 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 7 An alternative approach – illustrated by a small example loan The object-oriented loan

8 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 8 The object-oriented loan Hello, you should pay the instalment loan A loan-object may »Know its own balance, interest rate, installment dates etc. »Calculate its own interests »Ask for instalments »Accept instalments

9 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 9 The Person and the Loan – a simple collaboration diagram :Person:Loan askforInstalment PersonLoan classes

10 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 10 Allocation of responsibilities :Person:Loan askforInstalment PersonLoan classes calculateInterest( ) calculateBalance( ) calculateInstalment( ) askforPayment(amount,date) acceptPayment(amount) askHimforPayment(amount,date) remindHim(amount,date) acceptHisPayment(amount)

11 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 11 The communication between the real and the computerized part Example: remindHim(amount, date) lSend him a typed letter lSend him an lAsk a clerk to call him lSend a SMS-message to his Mobile Phone Person askHimforPayment(amount,date) remindHim(amount,date) acceptHisPayment(amount) the Protocol 4 different Use Cases!

12 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 12 The harmful boundary :object1 :object5 :object9 :object4 :object7 :objectn :object8 :object2 :object6 :object3 Computerized system

13 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 13 The better boundary :object1 :object5 :object9 :object4 :object7 :objectn :object8 :object2 :object6 :object3 Computerized system A user interface, may be described by Use Cases

14 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 14 My message – first part lThe boundary between the computerized system and the environment does neither go through messages between objects, nor does it coincide with the interfaces of some objects On the contrary: lThe boundary runs right through some objects, splitting them in a real world and a computerized part lThe communication between those two parts is governed by a protocol, which may be documented by Use Cases lThis protocol may involve communication between objects, but the on a lower abstraction level

15 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 15 My message – second part lA Use Case is a way to document the protocol between a human being (or another system) and a computerized system lIt is obviously wrong to lay down this protocol before we have »Decided upon the distribution of responsibilities between the human being and the computerized system »Decided upon the means of communication between the two lConclusion: Sequence/collaboration diagrams first!

16 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 16 Alternative sequence Use- Case view Logi- cal view Compo- nent view Concur- rency view Deploy- ment view Use-Case diagram Class/object diagram Sequence diagram Collaboration diagram State diagram Activity diagram Component diagram Deployment diagram Start here

17 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 17 Is the alternative method really ”better”? lDifficult to prove empirically – good designers make good systems even with bad methods But: lA method should not be obviously counterproductive in getting new ideas lThe basic models should be invariant with regard to organizational and technical solutions

18 IN 265 Problemformulering,.. Forelesning Arild Jansen Ifi 18 Punchline… l”A system is an inter-related set of components, with an identifiable boundary, working together for some purpose, and which we choose to regard as a whole” lIn other words: We select our systems to fit the purpose. lBefore doing so, we should know as much as possible about the purpose!


Download ppt "IN 265 Problemformulering,.. Forelesning 18.3.2003 Arild Jansen Ifi 1 Systems grenser mot omverdenen Forelesning IN 265 18.3-2003 Are Use Cases necessarily."

Similar presentations


Ads by Google