CS3505/5020 Software Practice II
Project #4: Review progress Use cases II Class diagrams II
CS 3505 L14 - 1
CS3505/5020 Software Practice II Project #4: Review progress Use - - PowerPoint PPT Presentation
CS3505/5020 Software Practice II Project #4: Review progress Use cases II Class diagrams II CS 3505 L14 - 1 How To Write Use Cases * Identify who will use the system 1. These users are called actors Actors are not
CS 3505 L14 - 1
CS 3505
1. Each thing that you figure out is a Use Case 2. Naturally there may be many Use Cases for each actor L08 - 2
CS 3505
1. “Actor does something” 2. “System does something” 3. “Actor does something” 4. “System does something” …
L08 - 3
CS 3505
L08 - 4
CS 3505
– FBaT believes that they sell more because the clerks provide the personal touch and can talk the customers into buying other things
– Go back and review the steps L08 - 5
CS 3505
L08 - 6
CS 3505
L08 - 7
CS 3505
L08 - 8
CS 3505
L08 - 9
CS 3505
– Main success flow (basic steps) – Exceptions (alternate flow) in a use case – Includes another use case – Extends another use case
L08 - 10
CS 3505
– A picture is worth a thousand words L08 - 11
CS 3505
L08 - 12
CS 3505
– Adding too much is a very bad plan
– If you want to have a prototype GUI add a separate image – Modeling some object relationships should be in a Class Diagram – Model dynamic object relationships in a sequence diagram
– Try not to have tiny Use Cases (decomposing into too small of a piece usually means that you are falling into “HOW”) – Try not to have giant Use Cases either
L08 - 13
CS 3505
?? 1 ?? ?? 2 ?? L08 - 14
CS 3505
?? Let’s look at two Use Case descriptions to help us
Use Case: Enter A Sales Order
The actor selects a customer from a list displayed by the system. Use Use Case "Lookup Customer". The system then displays the sales
for each item. The system displays a running total of the value of the
the systems resets ready for the next order.
Use Case: Lookup Customer
The actor selects a customer by entering their reference number. The system then displays the complete details of that customer, name, address etc along with a complete history of purchases they have made.
That means that Enter A Sales Order is really:
Use Case: Enter A Sales Order
The actor selects a customer from a list displayed by the system. The actor selects a customer by entering their reference number. The system then displays the complete details of that customer, name, address etc along with a complete history of purchases they have
Also, do we really want to show the customer’s history?
L08 - 15
CS 3505
L08 - 16
CS 3505
Simplify – all use cases apply to the user!! Even though we have lost information that information is most likely
L08 - 17
CS 3505
L08 - 18
CS 3505
L08 - 19
CS 3505
1.
2.
3.
4.
5.
6.
7.
8.
A B C L08 - 20
CS 3505
These compartments are optional. But if you need methods, then you have to have at least empty data member compartment. Important – if something isn’t specified, then that doesn’t necessarily mean that it isn’t there. For example, does name take an argument or not, does it return a value? L11 - 22
CS 3505
+doSomething()
A +service() B Void doSomething() { myB.service(); } +doSomething() A +service() B
1
UML Comment
These two diagrams are identical in what they mean. L11 - 23
CS 3505
– Class A simply knows of class B
L11 - 24
CS 3505
+setX(:double) +getX():double
A +operation() B public class B : A { … }
L11 - 25
CS 3505
L11 - 26
CS 3505
+speed(): double Car double speed() { … wheels[1] .. wheels[3] … } +type Wheel wheels 4
L11 - 27
CS 3505
L11 - 28
CS 3505
Team Player Captain Captain Leads 10 1 10 1
L11 - 29
CS 3505
– E.g., Glider has a component Tail – Composite object is the whole – Component is the part
– Stronger: composite should create component – Stronger: if delete composite, component goes away too, i.e., cascading delete
L11 - 30
CS 3505
– E.g., City is an aggregate of houses – Aggregate is the whole – Constituent is the part
L11 - 31
CS 3505
composition aggregation whole part part L11 - 32
CS 3505
– So, they recommend “don’t use it (choose composition or association)” – But you might see it – And some think that it makes sense L11 - 33
CS 3505
– Association, aggregation, composition, inheritance, dependency
– Name, roles, multiplicities – lifetime control L11 - 34