Presentation is loading. Please wait.

Presentation is loading. Please wait.

Requirements Analysis 1 Use Cases -> Class Diagrams Moving from the user towards the system.

Similar presentations


Presentation on theme: "Requirements Analysis 1 Use Cases -> Class Diagrams Moving from the user towards the system."— Presentation transcript:

1 Requirements Analysis 1 Use Cases -> Class Diagrams Moving from the user towards the system

2 Requirements Specification Requirements Gathering : asking questions, interviewing, observation, documents, prototypes Requirements documentation : use case diagrams, templates, architecture diagrams Requirements verification – have I got it right?

3 Requirements Analysis more detailed picture of requirements organised to facilitate software design A requirements model models requests in terms of what the system can do. It describes the internal structure and behaviour of the proposed system

4 From Use Case to UML Class Diagrams Use Case Realisation includes identifying a set of classes with an understanding of how they work together to provide the functionality of the use case. UML Class Diagram -a conceptual model that can be easily translated into software components but is language/platform independent.

5 First of all...... We need to get a static structural view of the system. Entity – Relationship Modelling techniques can help here. Identify entities (objects), their attributes, and relationships

6 From the detail in the use case diagrams and set of use case templates we can identify the main objects (classes) in the system. Their attributes – what describes them Their behaviour/methods – what events can change the state of the object

7 An object’s state changes when there is a change in: the value of one of its attributes or in the objects that it is related to

8 Flight Flight number Capacity Origin Destination Date/time Number of passengers booked Number of passengers checked in passengers booked passengers checked in Scheduleflight (date/time) Changecapacity(capacity) Book(passenger) Checkin(passenger) Cancelbooking(passenger) Reroute(origin, destination ) attributesOperations/methods

9 What objects could a flight be related to? Passenger : a passenger can travel on many flights, a flight has many passengers a flight has many Bookings a booking is for one flight a booking is for one passenger Are there lots of types of flight – if so maybe examine if we can use inheritance?

10 Types of Relationship (OOD) 1. Generalisation/specialisation (inheritance)...ISA, IS-A-KIND-OF A doctor is a staff member is a person 2. Aggregation/decomposition: collection or assembly- a-part-of, has-parts 3. Association e.g. A patient has many apppointments, an appointment is for one patient

11 3 main types of classes (stereotypes) Entity class – what the system keeps information about : things, concepts etc. Boundary class (user interface) Control class (logic of use case) These 3 types of class collaborate to realise the use case.

12 Class Attributes Relevant items of data that the system needs to keep track of e.g. ID, Name, address, phone, mobile, medical cardno/ money owed etc. If these are multiple, you might need another related class e.g. A patient has many appointments, treatments, prescriptions etc.

13 Identifying entity classes, attributes and relationships is similar to database E-R diagrams We show multiplicity in relationships E.g. a patient must have one doctor A doctor can have 0..100 patients

14 Example : Doctor’s surgery Use Case : Make appointment Patients wants appointment. Receptionist looks at doctor’s schedule for free appointments. Receptionist books the appointment Patients have family doctor Patients fill in a form with their personal details [name, address, phone, mobile, email, allergies, ongoing conditions]

15 What are the entity classes here? What are their attributes? How are they related?

16 Some more information... Use case: Record Treatment Doctor brings up their personal details on the screen. makes a diagnosis and enters into their treatment record. Use Case : Record payment Patient pays or gives medical card no

17 Can we add any more entity classes and relationships here?

18 List candidate entity classes Doctor Patient Appointment schedule Receptionist ? Treatment Payment?/Medical card Allergy? Condition?

19 Classes specify attributes and operations Attributes Describe classes Each object has its own May or may not change during the life of an object. Operations/methods Describe class behaviour

20 Identify some attributes of each candidate class Patient? Doctor? Appointment?

21 Object state When a piece of software is run actual objects or instances of classes are created. An object’s current state can be described by the values of its attributes and what objects it is currently linked to. The state of an object can be updated by sending it a message (invoking a method). Objects can be destroyed State diagrams show possible changes in state of an object

22 Links and Associations A link is a logical connection between 2 objects: Allowable links shown by association between 2 classes. e.g. Jenny has an appointment scheduled for 3.30 with her doctor and another at 4.30 with the nurse. Doctor Deeney has 10 appointments. –Links represent real world connections. –Associations represent the possibility of links.

23 Operations ( methods) Elements of common behaviour shared by all instances of a class (objects) They are eventually implemented by methods in a programming language. The state of an object can only be changed through invoking an operation sending a message to the object.

24 Identify some operations.. What can change the values of the attributes? What can change what the object is linked to?

25 Sample Structure class diagram Appointment Date Time Reason Type? Doctor id# Create () Cancel() Patient Id# Name Address Mobile Phone Email Doctor id# Medical card# Insurance# Account balance Create patient() Assigndoctor() Chargepatient(amoun t) Makeappointment() Viewappointment() Pay(amount). Delete() 1 0..* Has 0 or more.. Doctor Doctor id# Assign_patient Create () Deletel() View_patients() View-appointments(day); 1 0..* 1

26 Look at the example class diagram. How would the operations change the state of an object?

27 Example 2 : Car Hire Customer comes to hire a car. Specify category -small, medium luxury Find details of available cars Car is uniquely identified by reg# Customer’s details and details of the hire typed: e.g. id # and type; payment method, duration, Pick-up, and drop-off points. If. drop-off and pick-up points are different surcharge of £40.

28 Identify candidate entity classes Car Hire Customer

29 Clearly specify their relationships Car can have many Hires A hire is for one car A customer can have many hires A hire is for one customer

30 Sample Structure class diagram Hire Date/time of hire Date/time of pickup Date/time return due Pickup point Dropoff point car Create () Assigncar(car) Cancel() Customer Id# Name Address Mobile Phone Email balance Charge (amount) Pay(amount). 1 0..* Has 0 or more.. Car reg# Make Model Status (hired,available etc.) Create () Noteaccident() Hire() 1 0..*

31 Online DVD Library Customers can register with an online DVD library by entering their email address and personal details [Customer email and password, Customer Name, Customer address]. To borrow a DVD a customer logs onto the system, using their email address and password, browses a list of DVDs available and selects a DVD. DVD details contain the following: DVD Id, DVD title, cost of hire per night. The system checks if a copy of the DVD is available, and lets the customer know. If one is available they can order the DVD. When they do this, they must then pay by credit card. Once this payment is processed, a loan record is generated and a loan number is given to the customer. The loan record contains loan number, customer number, DVD id, Copy no., date of loan, date dispatched, and date returned.


Download ppt "Requirements Analysis 1 Use Cases -> Class Diagrams Moving from the user towards the system."

Similar presentations


Ads by Google