Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture 8 Object Concepts

Similar presentations


Presentation on theme: "Lecture 8 Object Concepts"— Presentation transcript:

1 Lecture 8 Object Concepts
COP 4331 – OOD&P Lecture 8 Object Concepts

2 UML – Intro. Case Study Problem:
Develop a computer system for a university library. The library currently uses a 1960’s program, written in an obsolete language for some simple bookkeeping tasks and a card index for user browsing. You are to build an interactive system which handles both of these aspects online

3 Case Study: Clarifying Requirements
Books and Journals May have several copies of a book Some books for short-term loan only Other books 3 week loan Only staff can borrow journals Members can borrow up to 6 books Staff can borrow up to 12 items Items can be added or removed Journals are bound at end of year

4 Case Study: Clarifying Requirements.2
Borrowing Must keep track of when items are borrowed, due, and returned Reminders for overdue items In future borrowers my extend load in book is not reserved Browsing Anyone can search for book by title, author, etc Check if book is available Reserve book

5 Case Study: Use Case Model
Identify the tasks performed by each user of the system User is called an actor in UML Actor can also be an external system Task is called a use case Must analyze each use case in detail

6 Case Study: Use case Borrow copy of book
A BookBorrower presents a book. The system checks that the potential borrower is a member of the library and that s/he does not already have the maximum permitted number of items on loan. (6 for member, 12 for staff) If the check succeeds, the system records that the member has this copy of the book on loan. Otherwise it refuses the loan.

7 Use Case Diagram, fig 3.1

8 Case Study: Initial Simplification

9 Case Study: Identifying Classes
Consider nouns and noun phrases in problem description Things in system include candidate classe

10 Candidate Classes Books and Journals: The library contains books and journals. There may be several copies of a book. Some books for short-term loan only. All other books are for 3 week loan. Only a member of the staff can borrow journals. Library members can borrow up to 6 books at a time. Staff can borrow up to 12 items.

11 Candidate Classes.2 Borrowing: The system must keep track of when books and journals are borrowed and returned, enforcing the rules described above.

12 Candidate Classes.3 Filter list, remove bad classes
Library: out of scope of our system Short-term loan: loan is really an event Week: measure of time Item: vague Time: outside scope of system System: from metalanguage of description Rule: from metalanguage

13 Candidate Classes.4 This leaves Book Journal Copy (of book)
Library member Member of staff

14 Candidate Classes.5 Library member and Staff member are users of the system Users do not always occur inside the system Unless their identity or other data about them needs to be retained

15 Relations Between Classes
Identify and name associations between classes Names indicate relationship or interaction Reveals multiplicity Helps clarify understanding of system Provides visualization of coupling

16 Initial Class Diagram, fig. 3.4

17 Revised Class Diagram, fig. 3.5

18 Interaction Daigrams Show interactions between actors and objects in the system over time Usually based on a use case or portion of one

19 Interaction Diagram, fig. 3.6

20 Changes in State: State Diagram, fig 3.7


Download ppt "Lecture 8 Object Concepts"

Similar presentations


Ads by Google