Documente Academic
Documente Profesional
Documente Cultură
1 Chapter 18
Object-Oriented Systems
Analysis and Design Using UML
4. A method is an action that cam be requested from any object of the class.
E. A class diagram.
F. A statechart diagram.
10. A use case model shows what the system does without describing how the
system does it.
Chapter 18 Systems Analysis and Design Instructor's Manual 18-3
14. An activity diagram is created for one use case and shows the different
possible scenarios. Activity diagrams include:
15. Activity diagrams are useful for viewing the overall activities of a use case
and for dividing the project into various team members.
18. The rules for creating sequence diagrams are that all interface classes
must be connected to a control class. All entity classes must be connected
to a control class as well.
20. Communication (called collaboration in UML 1.0) diagrams show how two
or more things perform a behavior that an individual thing cannot do alone.
They show the same information as a sequence diagram, but use numbers
to indicate the order of the activities.
21. Class diagrams show classes and the relationships between classes.
23. Method overloading is when a method may be defined more than once in a
class, and used differently. The number of parameters or the type of
parameter must be different.
25. Each type of class has a special symbol, called a stereotype, and extension
to the UML.
26. Data may be stored and re-transmitted between Web pages using one of
three methods:
27. Relationships are associations between classes. There are several types
of relationships:
31. Abstract classes are general classes or superclasses, and may not have
any direct objects themselves. Only the specialized classes may create
new objects.
33. Statechart (or state transition) diagrams show the different states that an
object may exist in and the events that cause an object to transition to a
different state.
34. A deferred event is one that is held until an object changes to a state that
can handle the event.
Analysis...
Problem definition...
Object reuse, of course, depends on the nature of the original objects. For
example, if the monorail and the mailroom objects have been designed and
developed without object-oriented design techniques and languages, it will be
very difficult to isolate the program code that manipulates the related data.
However, if the original work is object-oriented, the objects can be used as base
objects whose attributes and behaviors are selectively incorporated in creating
the warehouse robot objects. This reuse first occurs in the analysis and design
phase (reusing the design of the original objects), and secondly in the
programming stage (reusing the program code of the original objects).
Object-oriented solutions
How should Lisa go about reusing the work on the monorail in their current task
of creating a trolley object?
After sketching the design, Lisa should construct a partial prototype of the
warehouse robots to explore the feasibility of this reuse. Using object-oriented
languages or tools, she should develop enough new code to prove that the reuse
is feasible and useful in a practical sense. Once this is completed, and if the
prototype is convincing, then parts of the prototype program code can be used to
define objects and the object's attributes and behaviors.
UML itself only provides a set of notations for describing, analyzing, and
visualizing system requirements and designs, and it doesn't provide a pre-fixed
procedure or step-by-step instructions to do object-oriented (O-O) analysis and
design. In this case, we'll use the use case diagram, flow of events, and scenario
of UML to describe and determine domain requirements of end-users and
customers. Based on that, we'll proceed with O-O systems analysis and design
by determining the list of candidate objects as well as classes, drawing sequence
diagrams to describe interactions between objects, and working out class
diagrams.
Use case diagram represents the functionality of a system, i.e., what is the
system required to do for end-users from the perspective of an end-user? The
diagram is shown below.
User
Library Staff
Return Title/Copy Create New User
Flow of Events:
[1] A user enters his/her ID and associated password to log in to the library
system, which will be validated by the system.
[2] The user searches for a book/journal that he/she wants to borrow from the
library, and locate the copy of the book/journal from the bookshelf based
on the call number given by the search result.
[3] Both the user's library card and the copy are scanned into the system, and
the system checks if the borrowing criteria are met.
[4] Title/copy information as well as the user's borrowing records are updated
accordingly.
[5] If the copy has been previously reserved by the user, the reservation is
cancelled.
[6] The use case ends with the printout of a due-date notice.
[7] The user logs out of the system finally.
Alternative Flows:
[1] An invalid user ID or password is entered and the system prompts the user
to enter the ID or password again.
[2] No title name is matched from the search of the library system, and the
system prompts the user to change key words and submit the search
again.
[3] The system detects that the user hasn't returned a long overdue book, and
suggests to the user that he/she must return the book before he/she can
borrow any additional books/journals.
Chapter 18 Systems Analysis and Design Instructor's Manual 18-11
Scenario:
Mario enters his ID no."481" and password “pizza” into the login form of
the library system. The system validates the login and Mario enters into the
system.
The system's main menu appears on the screen and Mario chooses the
search function. A search form appears on the screen. He searches for the
book “World’s Wildest Animals” from the system and locates the book on
the bookshelf based on the call number given by the searching result.
His library card and the book's bar-code are scanned into the system and
the system checks to see whether Mario still has overdue books/journals or
other borrowing requirements are met.
If the book was reserved by Mario before, the system cancels the
reservation from the reservation record.
The system updates Mario's borrowing records as well as the records of
the title/copy.
The system prints out the due-date notice.
Mario logs out.
Flow of Event:
[1] This use case begins with a designated library staff entering his/her ID and
associated password into the system, and the system subsequently
validates the ID and password.
[2] After the staff selects the menu of ‘add title/copy’ from the system, he/she
enters the information of the title/copy such as the title name, authors'
names, ISBN number, the copy number or code, etc., and then save the
information.
[3] This use case ends when the title/copy is successfully added into the
system and the staff logs off.
Alternative Flows:
[1] An invalid user ID or password is entered and the system prompts the user
to enter the ID or password again.
[2] After the title name is input, the system searches and finds out that the title
name exists already in the system. The staff is prompted to enter a different
title name unless it is the same title but a different copy of the title.
Scenario:
Fabio enters his staff ID no. “007” and associated password “pp7” and the
system validates the login.
The system's main menu appears on the screen and Fabio chooses the
"Add Title/copy" function. The "Add Title/copy" form appears on the
screen. He then enters the title “Mary had a little lamb,” the author “Kool
Kev,” the publisher “Polar Duck,” and the ISBN “0-201-57169-5,” etc.
Chapter 18 Object-Oriented Systems Analysis and Design Using UML 18-12
After all relevant information is input, he clicks on the "Save" button on the
screen. The information of the title/copy is saved.
The system prompts the staff that the title/copy “Mary had a little lamb” is
successfully added to the system.
Fabio logs off.
Based on the flow of events and scenarios of use cases, a list of candidate
objects can be determined, as shown below (not an exhaustive list of candidate
objects).
[1] Main menu form - A list of all functions available for a user and/or a library
staff to choose.
[2] Login form - A form used for login validation of the library system.
[3] Search form - A form for a user to input key words in order to retrieve suitable
title/copy of book/journal.
[4] Title/copy form - A form for a library staff to input information of a title/copy
into the system's catalogue.
[5] Reservation record - An object that maintains reservation records of a user.
[6] A user's borrowing record - An object that maintains borrowing records of a
user.
[7] Reservation form - A form for a user to reserve a title/copy when the copy is
lent out of the library.
[8] Title - An object that maintains all information related to the title of a book or
journal.
[9] Copy - An object that maintains all information related to the copy of a title.
[10] Printout - A notice with the information about the due date of a borrowed
book/journal.
5. Sequence Diagrams
5: A dd("T itanic/copy2")
6: A dd( )
7: A dd()
8: A dd()
5: R eserve("T itanic")
6: R eserve("T itanic")
7: R eserve("T itanic')
Chapter 18 Systems Analysis and Design Instructor's Manual 18-15
1 : e n te r_ ID (u se r_ ID , p a ssw o rd )
4 : d isp la y( )
8 : Is a c o p y a v a ib le ?
9 : B o rro w ()
1 0 : D isp la y()
1 2 : U p d a te b o rro w in g re c o rd
1 3 : U p d a te re se rv a tio n re c o rd
1 4 : U p d a te C o p y In fo .
1 6 : P rin to u t()
Chapter 18 Object-Oriented Systems Analysis and Design Using UML 18-16
M ain M enu U serForm U pdateU ser U ser's Borrow ing U serR ecord
M ary:Staff
M anager R ecord
1:enter_Id(user_Id,passw ord)
2:validate_user(passw ord,user_Id)
4:D isplay()
1 : e n te r_ Id (u se r_ Id , p a ssw o rd )
4 : D isp la y()
7 : U p d a te ()
8 : U p d a te ()
5. Class Diagrams
0..1
Reservation Manager Reservation Record
(from ManagerClass) 1 0..*
1 0..* 0..*
1 0..1 1 1 1
MainMenu Reservation Form ReturnManager
1 1 (from ManagerClass)
0..*
Printout UserRecord
(from EntityClass) (from EntityClass)
1 1
0..*
1 0..1
1..*
BorrowingForm BorrowingManager BorrowingRecord
0..1 1 (from ManagerClass) 1 0..*
We can group some classes together and put them into packages, and then we
have following simplified package diagram, as shown below.
ManagerClass
EntityClass
InterfaceClass
BorrowingManager
Search() ReservationManager
Borrow()
UpdateReserve() AddReserve()
UpdateLendRecord() Update()
UpdateBorrowingRecord() Remove()
Printout()
ReturnManager
AddTitle/copyManager
Return()
UpdateReserve() Add()
UpdateLendRecord() UpdateReserve()
UpdateBorrowingRecord()
Chapter 18 Object-Oriented Systems Analysis and Design Using UML 18-20
MainMenu BorrowingForm
Title UserId
MenuItem CallNo
BorrowDate
display() 1 DueDate
SelectItem() 1
1 1 display()
add()
update()
remove()
1
Title/CopyForm
TitleName
AuthorName ReservationForm
Publisher
1 TitleName
ISBN
UserId
YearPublished
ReserveDate
CallNo
display()
display()
add()
AddTitle()
update()
UpdateTitle()
remove()
RemoveTitle()
Chapter 18 Systems Analysis and Design Instructor's Manual 18-21
UserRecord
ReservationRecord
UserID
BorrowingRecord UserName Title Name
UserId Address ReservedUserID
CallNo PhoneNo ReserveDate
BorrowDate Position CollectionDateB4
DueDate DateJoin
ReturnDate ExpireDate add()
EmailAddress 0..* check()
0..* 1 0..* delete()
add() FaxNo
delete() Update()
update() add() IsAvailable()
CheckOverDue() 1..* update()
Printout() remove()
0..1
0..1 Check()
Printout
(f rom Logical View)
0..* Ti tle of the printout 0..*
Copy Body of the printout
Title
CallNo
TitleName Printout() TitleName
PublisherYear AuthorName
ISBN NumberOfCopy
Publisher
Add()
0..* 1 Update()
Add()
Update() Remove()
Remover() IsAvailable()
IsAvailable()
C-Shore++
The way to manage a systems development process that does not have a fixed or
constant business processes as part of its goal set is to create a set of
independent objects that have minimal interactions with each other. The
interactions, or messages passed, should be designed so that making a change
in one object will have a minimal or no impact on another object.
The difference between an Object and a Class is that the class defines
shared attributes and behaviors of objects. An object is an instance or
occurrence of a class.
Object think adds information written in plain English about the properties
of an object and helps to clarify thinking about the object.
6. What is UML?
The two main types of diagrams in UML are structural diagrams and
behavioral diagrams.
A. Use case diagrams, showing the actors and the use cases.
B. Sequence diagrams that depict a succession of interactions between
object instances over time and they show the processing described
in use case scenarios.
Chapter 18 Object-Oriented Systems Analysis and Design Using UML 18-24
A use case model reflects the view of the system from the perspective of
the user outside the system. It describes what the system does, rather
than how the system works.
14. Would you describe a use case model as a logical or physical model of the
system? Defend your answer in a paragraph.
A use case model is a logical model because it describes what the system
does, rather than how the system works.
The three things that a use case must describe are the actor that initiates
the event, the event that triggers the use case, and the use case that
performs the actions triggered by the event.
Class diagrams show classes, attributes, methods (or operations), and the
relationships between classes.
Gen/spec diagrams are used to show general classes and the specialized
classes that inherits the attributes and methods from the general class.
Chapter 18 Systems Analysis and Design Instructor's Manual 18-27
A statechart diagram depicts the states that an object may have and the
events that cause the object to transition to a different state.
Problems
1. Create a series of CRC cards for World’s Trend Catalog Division. Once an
order is placed, the order fulfillment crew takes over and checks for
availability, fills the order, and calculates the total amount of the order. Use
five CRC cards, one for each of the following classes: order, order
fulfillment, inventory, product, and customer. Complete the section on
classes, responsibilities, and collaborators.
Chapter 18 Object-Oriented Systems Analysis and Design Using UML 18-28
Check Status
Customer
File Orders
Shipping Clerk
Establish Credit
Credit Manager
Added In
Deleted
Chapter 18 Object-Oriented Systems Analysis and Design Using UML 18-34
Sell Automobile
Salesperson
Pay Cash
«include»
Complete
Transaction
«include»
Arrange Loan
is a
tutor 1 student *
Teacher::Person Student::Person
::Faculty ::Course
Chapter 18 Object-Oriented Systems Analysis and Design Using UML 18-36
8. Coleman County has a phone exchange that handles calls between callers
and those receiving the call. Given these three actors, draw a simple sequence
diagram for making a simple phone call.
Chapter 18 Systems Analysis and Design Instructor's Manual 18-37
9. You are ready to begin the UML modeling for the Kirt Clinic. Draw a class
diagram that includes a physician, a patient, an appointment, and a patient’s
bill. Do not get the insurance company involved.
Chapter 18 Object-Oriented Systems Analysis and Design Using UML 18-38
10. Use the UML to draw examples of the four structural relationships for the
Kirt Clinic.
Employee
a kind
of
a kind of a kind of
Administrative
Doctor Nurse Personnel
Health Team
a part of a part of
a part
of
Administrative
Doctor Nurse Personnel
11. Write a sample use case scenario for a patient who sees a physician in the
Kirt Clinic.
an activity diagram showing the customer using the Web site to place an
order, verification of the order, order confirmation, order details sent to the
local store, and a customer email sent to the customer.
d. Create a class diagram for the entity classes used in the sequence
diagram.