Professional Documents
Culture Documents
ble
fe r a
ans
n - t r
a no
Object-Oriented ) has Analysis
e ฺ and
Design c o m
Using id
UML
u
e ฺ G
r a cl ent
@ o tuGuide
Activity d
a
m this S
e r
h ฺ vฺv use OO-226 Rev E
i t e s t o
(h ens e
a lic
Verm
h
H ites
D61808GC21
Edition 2.1
June 2010
D67901
Copyright © 2010, Oracle and/or its affiliates. All rights reserved.
Disclaimer
This document contains proprietary information, is provided under a license agreement containing restrictions on use and
disclosure, and is protected by copyright and other intellectual property laws. You may copy and print this document solely for
your own use in an Oracle training course. The document may not be modified or altered in any way. Except as expressly
permitted in your license agreement or allowed by law, you may not use, share, download, upload, copy, print, display,
perform, reproduce, publish, license, post, transmit, or distribute this document in whole or in part without the express
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
authorization of Oracle.
The information contained in this document is subject to change without notice. If you find any problems in the document,
please report them in writing to: Oracle University, 500 Oracle Parkway, Redwood Shores, California 94065 USA. This
document is not warranted to be error-free.
This training manual may include references to materials, offerings, or products that were previously offered by Sun
Microsystems, Inc. Certain materials, offerings, services, or products may no longer be offered or provided. Oracle and its
affiliates cannot be held responsible for any such references should they appear in the text provided.
ble
Restricted Rights Notice
fe r a
If this documentation is delivered to the U.S. Government or anyone using the documentation on behalf of the U.S.
an s
Government, the following notice is applicable:
n - t r
n o
U.S. GOVERNMENT RIGHTS
a
has eฺ
The U.S. Government’s rights to use, modify, reproduce, release, perform, display, or disclose these training materials are
restricted by the terms of the applicable Oracle license agreement and/or the applicable U.S. Government contract.
)
Trademark Notice
ฺ c om uid
r a cle ent G
Oracle and Java are registered trademarks of Oracle and/or its affiliates. Other names may be trademarks of their respective
owners.
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
V erm
h
H ites
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
a no
This page intentionally )left hasblank.
eฺ
o m i d
l e ฺc t Gu
o rac uden
a @ St
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
a no
This page intentionally )left hasblank.
eฺ
o m i d
l e ฺc t Gu
o rac uden
a @ St
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Table of Contents
bl e
About This Workbook ..........................................................Preface-ix
fe r a
Conducting the labs.............................................................. Preface-ix
an s
- t r
Conventions ............................................................................. Preface-x
n
no
Typographical Conventions ......................................... Preface-x
a
) h as ฺ
Additional Conventions............................................... Preface-xi
Examining Object-Oriented Concepts
ฺ c o m u ide
and Terminology..............1-1
Objectives ........................................................................................... 1-1
c l n t G
e ...........................................................
o r a de
Activity 1: Using Abstraction 1-2
a S tu
@ Inheritance............................................................
Activity 2: Using 1-3
Activity
e r m thi
3: Using s
Delegation and Cohesion ................................... 1-5
h ฺ vฺv u4:5:sUnderstanding
Activity e the Benefits of Using Interfaces ........ 1-6
i t e s Activity
t o Defining Object-Oriented Terminology ...................... 1-7
v
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Hotel System – Abstract of Additional Requirements (1)............ 3-3
Activity 2: Creating a Use Case Diagram ....................................... 3-4
Hotel System – Abstract of Additional Requirements (2)............ 3-6
Activity 3: Refining the Use Case Diagram.................................... 3-7
Creating Use Case Scenarios and Forms...................................... 4-1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
e h t4:o Validating
sActivity a Class Diagram........................................... 7-6
i t se from Analysis to Design
(hTransitioning
a e n
erm Usinglic Interaction Diagrams ............................................................ 8-1
h V Objectives ........................................................................................... 8-1
vii
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Preface
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Preface-ix
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Conventions
Conventions
The following conventions are used in this course to represent various
training elements and alternative learning resources.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Typographical Conventions
Courier is used for the names of commands, files, directories,
programming code, and on-screen computer output; for example:
Use ls -al to list all files. e
system% You have mail. r a bl
n s fe
Courier is also used to indicate programming constructs, such r a
-t as class
names, methods, and keywords; for example: n o n
a
The getServletInfo method is used to h
) asauthor
get
ฺ information.
The java.awt.Dialog class contains
omDialog e
idconstructor.
ฺ c G u
Courier bold is used for charactersr a cle and e n t
numbers that you type; for
o t u d
example:
r m a@ is S
ฺ
To list the v e in this
files e thdirectory, type:
# sls v
hฺ to us
it e
a ( h
e n se is also used for each line of programming code that is
lic in a textual description; for example:
Courier
erm referenced
bold
h V
H ites 1 import java.io.*;
2 import javax.servlet.*;
3 import javax.servlet.http.*;
Notice the javax.servlet interface is imported to allow access to its
life cycle methods (Line 2).
Palatino italics is used for book titles, new words or terms, or words that
you want to emphasize; for example:
Read Chapter 6 in the User’s Guide.
These are called class options.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Additional Conventions
Java™ programming language examples use the following additional
conventions:
Method names are not followed with parentheses unless a formal or
●
bl e
actual parameter list is shown; for example:
fe r a
“The doIt method...” refers to any method called doIt.
an s
n - t r
“The doIt() method...” refers to a method called doIt that takes
no arguments. a no
ha s
Line breaks occur only where there )are
●
o m i d eฺ code.(commas),
separations
e ฺ c
conjunctions (operators), or white
G u
space in the Broken code is
indented four spaces under
r a cl theestarting
n t code.
● If a command used
a @oin theStSolaris™
ud Operating Environment is
r
different from
e t h is used in the Microsoft Windows platform,
m a command
ฺv useare shown; for example:
bothvcommands
ฺ
e h
sIf working
t o in the Solaris Operating Environment
i t e
(h ens $cd $SERVER_ROOT/bin
a lic
Verm If working in Microsoft Windows
h
H ites C:>cd %SERVER_ROOT%\bin
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Lab 1
Terminology
Objectives e
r a bl
sfe
Upon completion of these activities, you should be able to:
- t r an
●
no
Define fundamental object-oriented (OO) concepts n
a
●
) h asassociations,
Create simple class diagrams using classes,
ฺ
inheritance,
and interfaces
ฺ c om uide
●
cle eand
Apply the concepts of cohesion
n G
t delegation to class diagrams
r a
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
1-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Using Abstraction
Preparation
No special preparation is required for this activity.
ble
Tasks fe r a
ans
n - t r
Complete the following step:
a no
1. Draw a UML class description for each of the
) hasfollowing
ฺ
business
ide
domain contexts:
ฺ c om context
u
a.
r a cle ent G
A Car in a “Used Car Lot” business
b. A Car in a “MotoroRacinguCircuit
a @ St d Game” business context
e r m this
Note – The h ฺ vฺv Circuit
“Motor u se Racing Game” can be a computer simulation
t e s game
or a iphysical t o (for example, Digital Scaletrix) with methods to
(h the s e
ncar.
rm acontrol
li c e
V e
e s h c. A Car in a “Vehicle Licensing Registration” business context
Hit d. A Car in any other business context agreeable to your group
(optional)
Note – You can refer to the example UML diagrams in Module 1 of the
Student Guide to review the graphical notation of a UML Class diagram.
Preparation
No special preparation is required for this activity.
Note – You can refer to the example UML diagrams in Module 1 of the
Student Guide to review the graphical notation for inheritance.
Note – The problem has a reduced scope to eliminate distractions that add
no value at this time. For example, we are not adding any aspects on
interest charged or interest payable.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Preparation
No special preparation is required for this activity.
Tasks bl e
fe r a
an s
Complete the following steps:
n - t r
1. no
Add the following details to the Class diagram that you created in
a
the previous activity:
) has eฺ
● Customer information (such
c o mas name,
u i daddress, and telephone
ฺ
number)
r a cle ent G
A businessocustomer
●
a @ number. S tudmust also have a company
e r m this
registration
h ฺ vฺv A upersonal
●
se customer might have a tax reference number.
i t e s A branch
t o code identifier (each branch in this bank has a unique
●
e
(h ens identifier)
a lic Bank name and address details
Verm ●
e s h
Hit
2. Ensure that your Class diagram satisfies the following condition:
A customer can have many accounts in this bank. However, an
account can be owned by only one customer.
Preparation
No special preparation is required for this activity.
Tasks ble
fe r a
ans
Complete the following steps:
n - t r
1. Read the following scenario:
a no
You were asked to write a software system
s can be used to buy
hathat
m ) d eฺ and sell behavior
c o
and sell property. You decided to delegate the
u i buy
that is specific to properties toleaฺPropertyTradingService
c en t G class
that includes the buy andra sell methods.
o tud
@asked
Now, you havem a
been
i s Sensure that this software system is able
to
r
e trading h
t of different types of items, such as vehicles
to support
and h ฺ vฺvmarket
stock
the
u s e
shares.
i t e s t o
2.(h Draw asclass
n e diagram that describes the classes and interfaces that
a e
ic be required to provide a flexible solution to the problem
Verm lwill
specified in step 1. You should ensure that new types of items can be
h
H ites added to the software system with minimal changes to the existing
software system.
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
definitions.
Term Definition
h Ve
association An instance of a class.
e s
Hit class Offloading some coherent responsibilities to
another component (one or more classes) or
method.
coupling A relationship between two classes.
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Lab 2
Development Process
Objectives e
r a bl
sfe
Upon completion of these activities, you should be able to:
- t r an
●
no
Define the workflows in the Object-Oriented Software Development n
a
(OOSD) process
) h as ฺ
●
c o m uideGathering workflow
Identify characteristics of the Requirements
● Identify characteristics of the
c l eฺ Requirements
n t G Analysis workflow
r a
o of the e
dArchitecture
● Identify characteristics
a @ S t u workflow
● Identify e r m thisof the Design workflow
characteristics
h ฺ vฺv benefits
Identify u seof modeling software
i
●
t e s t o
(h ens
● Define e the various Unified Modeling Language (UML) diagram
a lic types
Verm
h
H ites
2-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Defining Workflows
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Term Definition
Preparation
No special preparation is required for this activity.
Tasks
bl e
fe r a
As a group, complete the following steps:
a n s
n
1. Review the following front and plan views of an objectr
-t that a
company wants you to build: n o
a
) has eฺ
Front View
ฺ c om uidPlan/Top View
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
the lecture.
a. ___ Models give you only a starting point for a new system.
b. ___ Models help you only to understand what you have
developed.
c. ___ Models help you visualize new or existing systems.
ble
d. ___ Models are a concrete realization of a system.
fe r a
e. ___ Models help you communicate decisions to project ans
stakeholders. n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Self-Check – Match the UML diagram with its description of the diagram
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
type.
ble
fe r a
ans
n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
V erm
h
H ites
Objectives
bl e
Upon completion of these activities, you should be able to:
fe r a
Identify the essential elements in a Use Case diagram an s
●
n - t r
●
FRs provided by the business owner a no
Extend a Use Case diagram based on a list of additional high-level
i t e sh to
a (h ense
erm lic
h V
H ites
3-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Identifying Use Case Symbols
Self-Check – Write the name of each Use Case diagram symbol in the
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
e
r a bl
s fe
- t r an
n o n
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
ฺ ฺv use
vGetEmployeeInfo
e s h t o
i t
(h ens e
a lic
Verm
h
ites
H
Abstract e
r a bl
sfe
The receptionist must be able to check out customers before they leave the
- t r an
hotel. During the check-out procedure, a customer’s bill is calculated and
no n
a
presented to the customer. In most cases, immediate payment is required
has eฺ
to settle the bill for any outstanding room, meal, or other chargeable items
)
om uid
added to the bill during the stay. The most common payment method is in
ฺ c
the form of a credit card or a debit card.
r a cle ent G
Some customers will @ o all ortupart
have d of their bill guaranteed by a
a
m thfor
purchase order.rInvoices S
is these charges will be generated daily and
e
vฺv orusent
either printed
h ฺ seelectronically to the company or travel agent.
i t e s t o
(h ens
Customers ewho are currently checked-in, but have not yet checked-out,
a liccharge food, beverages, or other services to their room account.
erm
can
h V
H ites The room telephone is enabled upon check-in and disabled upon check-
out.
Figure 3-1 illustrates the initial Use Case diagram of the Hotel System.
ble
fe r a
ans
n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Preparation
No special preparation is required for this activity.
Tasks
Complete the following steps:
1. Read the abstract of additional requirements for the Hotel System
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Abstract
The marketing staff can publish current offers to their customer base via
e-mail. ble
fe r a
The hotel group does not currently have a loyalty scheme. However, the ans
group is affiliated with airlines, car rental companies, and other reward n - t r
a no
points schemes. For example, customers traveling on affiliated airlines
has eฺ
will earn airmiles. Customers that have registered a loyalty card will have
)
om uid
points awarded to that external scheme when their bill for a reservation is
settled. ฺ c
r a cle ent G
Customers who provided @ ao ud must be sent a text message
phone tnumber
m a S
is arrival date. This is a courtesy text
during the morning
e r of their due
t h
vฺv uthem
message reminding
h ฺ se of their booking.
i t e s t o
(h ens
Cleaners can e
request a list of rooms that have been vacated. Once a
a lic room has been prepared for the next customer, the cleaning staff
rm vacated
V e must mark the room as ready for use.
e s h
Hit Occasionally, there are discrepancies in a customer’s bill. Therefore, the
receptionist may need to make adjustments to the bill.
Night auditors will request that the system generates a discrepancy report
during the night. Based on this report, the night auditors might need to
make adjustments to a customer’s bill. The duty of night auditors is
complete for that night only when there are no more discrepancies.
Preparation
bl e
fe r a
No special preparation is required for this activity.
an s
n - t r
Tasks a no
) has eฺ
Complete the following steps: ฺ c om uid
r a
1. Read the abstract of additional
tG
cle erequirements
n for the Hotel System
o t u d
r m a@
that is provided
i s S
on the preceding page.
e th
2. Createฺvaepackage structure to hold different use case views.
ฺ v s
h thetouseu cases, actors, and associations created in “Activity 2:
3. esCopy
i t se a Use Case Diagram” to the relevant package views.
(h eCreating
a n
erm lic
h V
H ites Note – A use case or actor may be shown in several Use Case diagram
views.
4. Refine the Use Case diagram views by adding actors, use cases, and
associations for the newly discovered requirements.
5. Refine the Use Case diagram views by expanding any high-level use
cases.
6. Refine the Use Case diagram views by showing dependencies
between use cases.
7. You may, if time allows, add other use cases or use case
dependencies not mentioned in the additional requirements, that
would enhance your understanding.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Objectives
bl e
Upon completion of these activities, you should be able to:
fe r a
Create brief descriptions of the main scenarios for a use case an s
●
n - t r
●
scenarios a no
Fill in portions of a Use Case form to document a use case and its
) as ฺ to the project’s
hscenarios
om uide
● Add some business terms found in the
Glossary of Terms ฺ c
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
4-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Examining Use Case Scenarios
Preparation
No special preparation is required for this activity.
Tasks ble
fe r a
ans
Complete the following steps:
n - t r
1. no
Read the following key facts of the Check In use case that were
a
has eฺ
determined during a meeting with some of the stakeholders:
)
●A reservation can be identified
c o m i
by customer
u d name—in which
ฺ G than one customer—or
case, the reservation may
r
by reservation number. a cInlematch
both e n
more
t
situations, it is possible that the
o t u d
r m a@ ifiscustomer
required reservation isSnot found. For example, the reservation
will not
ฺ v e be t
found
e h name is not spelled correctly or if
s h ฺvreservation
the
u s number provided is not correct.
ite The e t o
customer may be given the option of upgrading any of the
( h ●
n s
a lice reserved rooms, in which case the additional cost will need to
e r m be calculated.
h V
H ites ● The customer may ask to change any of the booked rooms for
an alternate room of the same type. For example, the customer
asks the Receptionist if the room has a view and is told that the
room does not have a view. In this case, the customer might ask
the Receptionist to change the room.
● Payment pre-authorization may be obtained unless already
guaranteed for the additional services—such as, meals,
beverages, and movies—that may be purchased. For example,
the customer’s credit card may be pre-authorized with the
Electronic Payment Services.
● If there is no payment guarantee for the additional services,
customers are not allowed to charge any items to their bills.
● If check-in is successful, an electronic room key is generated for
each reserved room.
Note – This list of key facts is not an exhaustive list. Your group may wish
to add to this list during the lab.
bl e
2. Create a brief description of a primary (successful) scenario. fe r a
a n s
3. Create a brief description of any other primary (successful)
n r
-t scenarios
and any secondary (unsuccessful) scenarios that n o
could occur.
a
as ฺ in ‘‘Activity 3:
4. Revisit the Use Case diagram that youhrefined
)
Refining the Use Case Diagram’’ m
o on page L3-7
i d e of this workbook, and
c
ฺ correct.
determine if the diagram isestill
l u
G If not, update the diagram.
c
ra repeat n t
@ o
5. Optionally, if time allows,
t u de steps 2 through 4 for another use
r m a is S
case (for example, Charge Customers Bill or Check Out Customer).
ฺ v e e th
v
hฺ to us
it e s
a ( h
e n se
erm lic
h V
H ites
Preparation
Your instructor should hand you a Use Case form template to document
the use case. Alternatively, you can use a flip chart or a whiteboard to
write the details of the Use Case form.
ble
Tasks fe r a
ans
n - t r
Complete the following steps:
a no
1. Complete all the elements of the Use Case form
) as from
hCheck ฺ
the information
included in the Use Case scenario for the
o m i d eIn use case, which
l e ฺc tand
you completed in the previous activity,
G uthe key facts provided in
the previous activity.
o rac uden
@ repeat
2. Optionally, if timeaallows, S t step 1 for another use case (for
example, Charge s
erm Customers
thi Bill or Check Out Customer).
ฺv ฺ v e
s h t o us
it e
a ( h
e n se
erm lic
h V
H ites
Preparation
No special preparation is required for this activity.
Tasks bl e
fe r a
an s
Complete the following steps:
n - t r
1. no
Identify a few business terms used in the scenarios of “Activity 1:
a
) has eฺ
Examining Use Case Scenarios” or in the Use Case form of “Activity
2: Creating Use Case Forms” that would need to be defined in the
ฺ c om uid
project’s Glossary of Terms.
a
2. Write a definition forreach
t G identified in step 1.
cleof theenterms
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Lab 5
Objectives
bl e
Upon completion of these activities, you should be able to:
fe r a
Identify the essential elements in an Activity diagram an s
●
n - t r
● Create an Activity diagram to model a Use Case diagram
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
5-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Actrivity1: Identifying Activity Diagram Symbols
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
fe r a
Design Product
ans
n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Preparation
No preparation is required for this activity.
Task bl e
fe r a
an s
Complete the following steps:
n - t r
1. no
Examine the flow of events in the solution Use Case form from the
a
lab exercise in module 4.
) has eฺ
2. Create an Activity diagram to represent
ฺ c om uthe id flow of events.
3. Start your diagram withcale n t
start node.G
r a derepresent each activity from the Use
4. Beginning with @ the o t u
first activity,
Case formrasm a is Snode. You may represent a complex set of
ฺ v th node in the main activity diagram, then
an activity
eas oneeactivity
v
activities
us activities in another activity diagram.
hฺ thetointernal
it e s
show
a ( h
e n se
erm lic
h V Note – Start with a simple diagram using branching, iteration, and
e s concurrency. Then add swimlanes, interruptible activity regions, and
Hit object flow where necessary
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Lab 6
Objectives
bl e
Upon completion of these activities, you should be able to:
fe r a
Identify candidate key abstractions from the project artifacts an s
●
n - t r
● Use Class-Responsibility Collaboration (CRC) analysis to identify
n o
a
key abstractions from candidate key abstractions
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
6-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Finding Candidate Key Abstractions
Preparation
No special preparation is required for this activity.
Tasks ble
fe r a
ans
Complete the following steps:
n - t r
1. no
Using the use case forms, scenarios, and glossary descriptions from
a
) has eฺ
the previous lab, identify the candidate key abstractions and list
them in a candidate key abstraction template form.
c o m uid
ฺ tG
the example in Module 6ra
cle enand
2. Using the use case forms, scenarios,
of the Student
glossary descriptions from
Guide, identify any
@keyo abstractions
tud and then add them in a
additional candidate
m a S
istemplate form.
candidate keye r t h
abstraction
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Preparation
No special preparation is required for this activity.
Tasks
bl e
fe r a
Complete the following steps:
a n s
1. Select a candidate key abstraction from the candidate n r
t abstraction
-key
solution of the first activity in this module. n o
a
2. Identify whether there is a use case inhwhich
) as theฺ candidate key
abstraction is prominent. If the o m uid
candidate e abstraction is not
key
prominent in a use case, itle ฺ c Gnot a key abstraction.
r a c probablyn t is
3. Scan the relevant project
@ o artifacts
t u de to identify responsibilities and
collaboratorsm for S key abstraction. If the candidate key
a the icandidate
s
r
ve does h
t have any responsibilities or collaborators, it
ฺ v ฺ
abstraction
s e not
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Lab 7
Objectives
bl e
Upon completion of this module, you should be able to:
fe r a
Identify the essential elements in a Class diagram an s
●
n - t r
●
adding key abstractions a no
Extend the Domain model class diagram of the Hotel System by
has diagram
Identify the essential elements in an)Object eฺ
●
o m i d
● Validate the Domain model l e ฺc one
using
t G umore Object diagrams
or
o rac uden
a @ St
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
7-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Identifying Class Diagram Elements
Self-Check – Write the name of each Class diagram symbol in the space
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Account
ble
Account
fe r a
firstName:String
lastName:String
ans
Amount:BigDecimal
getAmount()
n - t r
setFirstName()
n o
a
1..* ) has eฺ
ฺ c om uid
r a cle ent G
employs
a @o Stud
e r m this
h ฺ vฺv use ClassB
i t e s
ClassA
t o
(h ens e
a lic
Verm
h
H ites ClassX
Preparation
Copy the classes from the Domain model class diagram of the Hotel
system that is shown in Figure 7-1.
bl e
fe r a
1..* made for 1
an s
Reservation
resv cust
Customer
n - t r
reservation number 1..* a
first name no
has eฺ
status last name
res
arrival date v )
address
departure date
1 g
ฺ c om uid
phone number
ua
ra
a c le nt G
<<operations>> nt
ee r
o1..* tude 1..*
reserve a room @ d
a roiosm S Room
by located at 1
e r m t h Property
vฺv use
room property
s h ฺ
i t e e t o 1
( h
a licen s Payment
r m Guarantee
h Ve
es
Hit
Figure 7-1 Domain Model Class Diagram of the Hotel System
Ensure that you leave space for new classes, attributes, and operations.
Tasks
Complete the following steps:
1. Add new class nodes for each key abstraction that you found
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Self-Check – Write the name of each Object diagram symbol in the space
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Bryan:Account
bl e
fe r a
an s
:Account n - t r
a no
) has eฺ
:Account
ฺ c om uid
cle ent G
firstName:Bryan
lastName:Smith
r
Amount:10.29a
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(hSelf-Check e
nsthat – Select the statement or statements about UML Object
rm a c e
h
✓V e li
diagrams are TRUE.
e s
Hit a. ___ Object diagrams can be validated using Class
diagrams.
b. ___ Object diagrams show runtime links.
c. ___ Object symbols can have three
compartments: name, attribute, and an
operations compartment.
d. ___ Object diagrams often show object state.
e. ___ An Object diagram is an instance of a class
diagram.
Preparation
Choose a subset of classes that you want to model as objects. This subset
of classes should be based on the classes used in the primary (successful)
scenario that you created for the Check In use case in ‘‘Activity 1:
Examining Use Case Scenarios’’ on page L4-2 of this workbook. ble
fe r a
ans
Tasks n - t r
a no
Complete the following steps:
) has eฺ
1. Draw an object node for each key ฺ c om uidin the scenario.
abstraction
r a
2. Draw links between collaborating
tG
cle eobjects.
n
3. Follow a partial flowa @ofothe Schosen
tud scenario, changing your object
e r t h is
m progresses.
ฺ v ฺv use
model as the flow
4. Compare
e h
s thetoObject diagram to the Domain model.
i t
(h ense
rm a lic
V e
e s h
Hit
Interaction Diagrams
Objectives e
r a bl
sfe
Upon completion of these activities, you should be able to:
- t r an
●
no
Identify the essential elements of a Communication diagram n
a
● Create a Communication diagram
) has eฺ
● Identify the essential elements of
ฺ c om u id diagram
a Sequence
● Create a Sequence diagram
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
8-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Identifying Communication Diagram Elements
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
:Account fe r a
ans
n - t r
n o
a
2.1: getAccountInfo()
) has eฺ
ฺ c om uid
r
<<create>>
a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s :MainUIto
a (h ense
erm lic
h V
H ites :AccountSvc
Bill:Customer
Preparation
You will need the Check-In Use Case Form from Lab 4.
Tasks bl e
fe r a
an s
Complete the following steps:
n - t r
1. no
Read the main flow of events in the Check-In Use Case Form.
a
2. Place the actor for the use case on theh
) as ฺ
diagram.
3. Analyze the flow of events. For ฺ c m action
oevery u idein the use case:
a. Identify and addra boundary tG
cle encomponents.
o tud
@add
b. Identify and
m a i s S components.
control
r h
ฺve usand
c. Identify
ฺ v e tadd entity components.
i t e sd.h Draw t o the associations between these components.
e
(h ee.ns Label the actions performed by each component to satisfy the
a lic interactions in the use case.
Verm
h
H ites 4. Optionally create another diagram or fragment diagram for another
scenario.
Note – If your group prefers, you may do activity 4 before doing activity
2. In which case you may find it easier to convert from the Sequence
diagram created in activity 4.
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
Customer
fe r a
ans
:Account n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
message()
Preparation
You will need the Check-In Use Case Form from Lab 4.
Tasks
bl e
fe r a
Complete the following steps:
a n s
1. Read the main flow of events in the Check-In Use Case n r
-t Form.
o
n diagram.
2. Arrange the components at the top of the Sequence a
Hint: Put actors and boundary components ) has eonฺ the left, followed by
service components in the middle, ฺ c omand uentities
id on the right.
l e
cactivation n G
t for each message in the first
3. Add message links and r a e bars
activity.
a @o Stud
4. RepeatvStep e rm3 for each
t h isactivity in the use case until the task is
h ฺ vฺ use
complete.
i t e s t o
(h ens e
a lic – If you have done activity 2 then you may find it easier to convert
Verm Note
h from the Communication diagram.
H ites
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Lab 9
Diagrams
Objectives e
r a bl
sfe
Upon completion of these activities, you should be able to:
- t r an
●
no
Identify the essential elements in a State Machine diagram n
a
●
) has eฺ object
Create a State Machine diagram for a complex
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
9-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Identifying State Machine Diagram Elements
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
AcctOverdrawn
ble
fe r a
ans
n - t r
AcctOverdrawn
n o
a
has eฺ
entry / notifyCustomer
entry / doNotAllowSpending
exit / allowSpending)
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Preparation
No special preparation is required for this activity.
Tasks
bl e
fe r a
Complete the following steps:
a n s
1. Read the following description for a complex Account n r
-t object.
n o
● All accounts start with a balance of zero.
s a
● An account with a balance greater ) hathan e ฺ equal to zero has a
or
state of “Active.” Whenฺc o m i d
u active, a customer may
accounts are
deposit any amountcof l emoney,
n t G
withdraw any amount of money
r a
(as long as theooverdraft e
dlimit is not reached), and transfer
a @the Active
S tuaccount
moneym
r from
h i s to another account.
ฺ v ฺve use t
i t e s–hAn overdraft
t o limit is a set amount that a customer’s account can
Note e
(hhaveeinnshort-term
s
r m a l i c (less than 3 months) debt without being frozen. It is
Ve similar to a short-term loan from the bank. For example, if the bank gives
h
ites
their customers an overdraft limit of $100.00, it means that a customer’s
H account balance can be –$99.99 without being frozen. But as soon as the
account goes to –$100.00 or below, it is frozen and the customer can no
longer withdraw money.
a c le nt G
any accounts with this bank again.
r defalls below zero by an amount
@o limit,
● Whenever the account balance
equal to the a overdraft t u
S the account state is changed to
“Frozen.” r m i s
th bullet for information on the Frozen
e Seeeprevious
v ฺ v
s ฺ
hstatus. t o us
h e
it Ifsaneaccount is closed by the customer, the account state is
( ●
a licenchanged to “Closed” and the customer can no longer use the
e r m
h V account.
H ites 2. Choose the initial and final states for the object. Specify the
preconditions of the initial state and the post conditions of the final
state.
3. Choose the stable states of the object.
4. Specify the partial ordering of stable states over the lifetime of the
object.
5. Specify the events that trigger the transitions between the states of
the object. Specify transition actions (if any).
6. Specify the actions with a state (if any).
Model
Objectives e
r a bl
sfe
Upon completion of these activities, you should be able to:
- t r an
● Apply the Composite Reuse Principle (CRP) n o n
a
● Apply the Strategy pattern
) has eฺ
● Apply the Observer pattern
ฺ c om uid
Apply the State patternacl
e nt G
●
r
o tude
@
a is S
r m
e e th
v ฺ v
e s hฺ to us
( h it se
a e n
erm lic
h V
H ites
10-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Applying CRP
Preparation
No special preparation is required for this activity.
Tasks
ble
fe r a
Complete the following steps:
a n s
-t r
1. Read the following information pertaining to a VehiclenInformation
System: n o
a
as ฺ types of vehicle
You need a system to record the details ofhvarious
)
that can move on land, water, air, or
ฺ c o m i de of these terrains.
a combination
u
G for each vehicle
cle toebentrecorded
The information that is required
includes the following:ora
a @ Stud
weight
●
e r m this
ฺ v sedimensions (h,l,w), where h stands for height, l
vฺMaximum
●
h
s standst o ufor length, and w stands for width
i t e
a (h ensePower sources with fuel type
●
erm lic
h V ● Maximum speed on each terrain
e s
Hit
● Certification information (airworthiness, seaworthiness,
and land vehicle inspection).
Your job is to ensure that the system can accommodate these
different types of vehicle and can be easily modified for new terrains
and power sources in the future.
2. Draw a single Class diagram that shows how CRP can be applied to
the problem to create a flexible solution.
Preparation
No special preparation is required for this activity.
Tasks bl e
fe r a
an s
Complete the following steps:
n - t r
1. no
Read the following information pertaining to the Hotel System case
a
study.
) has eฺ
The marketing department of the
c o mhotel uwill
i d implement various
ฺ t G the quoted price. These
offers may include the r a cle toecalculate
discount offers that are used
following: n
a @o staySfor tudthe price of one night, provided it is a
e
Two
●
r m this is, Friday, Saturday, or Sunday.
nights
vฺv 5 nights
weekend—that
h ฺ u se stay for the price of 4 nights at any time during the
i t e s t o
●
e
(h ens offer period.
a lic
erm 10% discount during the offer period.
●
Preparation
No special preparation is required for this activity.
Tasks ble
fe r a
ans
Complete the following steps:
n - t r
1. no
Read the following information pertaining to the Hotel System case
a
study:
) has eฺ
When a customer vacates a room after
c o mchecking
u i d out, various
ฺ
e should Gnotified immediately and
individual members of the staff
departmental display screens r a clshould n t be
e updated. The individual
be
o
@be notifiedt u d
staff members should
m aThese i s S byofathe message sent to a portable
e
hand-held device.
v r t h members staff should include a
ฺv ฺ
chambermaid, e
s housekeeping supervisor, the mini-bar stockist,
the
u
s h t o
e roome maintenance.
( h itand
shownthes
The departmental display screens should
status of rooms in various departments including
r m a lhousekeeping
i c e and maintenance.
Ve
h
ites
Your job is to ensure that the Hotel System includes the functionality
H to notify the concerned members of the staff and update the
departmental display screens as soon as possible after the room
becomes vacant. You must also ensure that when a room becomes
vacant, other notifications that may be required in the future can be
added easily.
2. Draw a single Class diagram that shows the Observer pattern
solving the problem in the case study.
● Create a Class diagram that implements the State pattern for the
previous example.
Preparation
No special preparation is required for this activity. bl e
fe r a
an s
Tasks n - t r
a no
Complete the following steps:
) has eฺ
c m This
ocode. u idlarge block of code is
1. Examine the following pseudo
e ฺ G
r a cl object
currently used in the Account
e n t to ensure that it acts
appropriately whenoa customer
a @ Stud attempts to withdraw money.
r m this{
withdrawlMethod()
e
h ฺ vฺv use
i t e s if (accountStatus
t o = “Active”) {
(h ens eallow customer to withdrawl up to (OverdraftLimit
a lic
erm
+ currentBalance);
h V }
e s else if (accountStatus = “Overdrawn”{
Hit DisplayMessage(“You are Overdrawn”);
allow customer to withdrawl up to (OverdraftLimit
+ currentBalance);
}
else if (accountStatus = “Frozen”) {
DisplayMessage(“Account Frozen, you cannot
withdrawl money, please visit with bank manager”);
}
else {
DisplayMessage(“Account is closed, you cannot
withdrawl money.”
}
2. Given what you know about the State pattern, how would you
refactor this code?
ble
fe r a
ans
n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Diagrams
Objectives e
r a bl
sfe
Upon completion of these activities, you should be able to:
- t r an
●
no
Identify the tiers, layers, and systemic qualities for the SunTone n
a
Architectural Methodology
) h as ฺ
● Identify the essential elements of m
o a Component
i d e diagram
l
Identify the essential elements
c G u
eฺ of na tDeployment diagram
●
r a c
● Create a high-level o
@ Deploymentt u dediagram
r m a is S
ฺ v e e th
v
hฺ to us
it e s
a ( h
e n se
erm lic
h V
H ites
11-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Identifying Tiers, Layers, and Systemic Qualities
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Layer Definition
Application Provides the APIs that application
components implement
Virtual Platform Consists of the operating system
Upper Platform Includes computing components such as
ble
servers, storage, and network devices
fe r a
ans
Lower Platform Provides a concrete implementation of
n - t r
requirementsa no
components to satisfy the functional
o rac uden
a @ St
e r m this
vฺv uthe
Self-Check – Match
h ฺ setiers with their definitions.
✓ i t
(h ens
e s
e t o
r m a Tier
l i c
Definition
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
<<JAR>>
PayrollSystemJAR
ble
fe r a
ans
<<reside>>
n - t r
n o
a
) has eฺ
ฺ c om uid
* rac
le nt G
@ o tude
r m a is S
ฺ v e e th
v
hฺ to us
it e s
a ( h
e n se *
erm li c
h V
ites
DBMS
H
DrawApp
*
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
<<FTP>>
ble
<<JAR>>
fe r a
ans
PayrollSystemJAR
n - t r
n o
a
) has eฺ
PC ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Self-Check – Select the statement or statements about UML Deployment
Preparation
Read the following requirements pertaining to the Hotel System case
study:
e r m this
requirements provided 3 Lab 10.
h ฺ
The bookingvฺvagentu e
s(internal staff) must be able to manage reservations on
e s t
it ofscustomerso
( hbehalf
n e who telephone or e-mail with reservation requests.
r m a lice
The majority of these requests will make a new reservation, but
Ve occasionally they will need to amend or cancel a reservation. A reservation
h holds one or more rooms of a room type for a single time period, and must
H ites be guaranteed by either an electronic card payment or the receipt of a
purchase order for corporate customers and travel agents. These payment
guarantees must be saved for future reference.
A reservation can also be made electronically from the Travel Agent system
and also by customers directly via the internet.
The receptionist must be able to check out customers before they leave the
hotel. During the check-out procedure, a customer’s bill is calculated and
presented to the customer. In most cases, immediate payment is required
to settle the bill for any outstanding room, meal, or other chargeable items
added to the bill during the stay. The most common payment method is in
the form of a credit card or a debit card.
The room telephone is enabled upon check-in and disabled upon check-
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
out.
The marketing staff can publish current offers to their customer base via
e-mail.
The hotel group does not currently have a loyalty scheme. However, the
group is affiliated with airlines, car rental companies, and other reward
points schemes. For example, customers traveling on affiliated airlines ble
will earn airmiles. Customers that have registered a loyalty card will have fe r a
points awarded to that external scheme when their bill for a reservation is ans
settled. n - t r
a no
Customers who provided a phone number must
) h abes sent
ฺ a text message
during the morning of their due arrival date.
ฺ c om This
u idisea courtesy text
cle ent G
message reminding them of their booking.
r a
Cleaners can request aa @oforooms
list S
d have been vacated. Once a
tuthat
vacated room has been
e r m prepared
t h is for the next customer, the cleaning staff
must mark ฺthe
h vฺvroomuasseready for use.
i t e s t o
(h a ecustomer
When n e
s vacates a room after checking out, various individual
a
rm members c
li of the staff should be notified immediately and departmental
V e display screens should be updated. The individual staff members should
e s h
Hit
be notified by a messages sent to a portable hand-held device. These
members of the staff should include a chambermaid, the housekeeping
supervisor, the mini-bar stockist, and room maintenance. The
departmental display screens should show the status of rooms in various
departments including housekeeping and maintenance.
Your job is to ensure that the Hotel System includes the functionality to
notify the concerned members of the staff and update the departmental
display screens as soon as possible after the room becomes vacant. You
must also ensure that when a room becomes vacant, other notifications
that may be required in the future can be added easily.
Tasks
Complete the following steps:
1. Create a high-level Deployment diagram from the selected
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Lab 12
Objectives
bl e
Upon completion of these activities, you should be able to:
fe r a
Update and extend the tiers and layers package diagram used in the an s
●
example case study for the Hotel System. n - t r
n o
a
Extend the DAOFactory used in the example case study to allow a
has eฺ
●
change of database and the integration of external resources
)
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
12-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Update and Extend a Tiers and Layers diagram
Preparation
No special preparation is required for this activity.
Tasks ble
fe r a
ans
Complete the following steps:
n - t r
1.
a no
Open the TiersAndLayers.pdf file located in the
exercises/ArchTiers/ directory.
) has eฺ
c o
2. Update and extend the Tiers and Layers m diagram
u i d by using the
ฺ
r a cle ent G
information provided in the TiersAndLayers.pdf file.
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Preparation
No special preparation is required for this activity.
Tasks bl e
fe r a
an s
Complete the following steps:
n - t r
1. no
Create a Class diagram containing the DAO classes that will allow
a
) has eฺ
you to access two different data sources. You only need to show a
representative number of DAOs to support the Reservation and
Customer entities. ฺ c om uid
2. Add the DAOFactoryra
cle enwill
classes you
t Grequire to create the DAO
objects. a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Lab 13
Objectives
bl e
Upon completion of these activities, you should be able to:
fe r a
Refine attributes an s
●
n - t r
● Encapsulate attributes
a no
● Refine associations
) has eฺ
● Refine methods
ฺ c om uid
● Declare constructors
r a cle ent G
Review your class o totuensure
@design d that it maintains high cohesion
●
a
m this S
r
and low coupling
e
●
h ฺ
Createvฺvcomponents
u se with well-defined interfaces
i t e s t o
(h ens e
a lic
Verm
h
H ites
13-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Refining Attributes
Preparation
Review the Class diagram of the Hotel System case study that you created
in ‘‘Activity 2: Extending a Class Diagram’’ on page L7-3 of this ble
workbook. This Class diagram is the starting point for this activity. fe r a
ans
n - t r
Task 1 – Refine Attributes a no
) has eฺ
Complete the following steps:
ฺ c om uid
1. Refine the class attributesa incthe G
le Classntdiagram.
r
o attribute
u dtoe follow convention.
2. Refine the name of @
a is S
each t
r m
edata typethfor each attribute. Create new <<utility>>
3. Identify the
v ฺ v e
s ฺ necessary.
typeshif
t o us For example, the arrival date and departure date
h e
itcould be ecombined into a DateRange class with a method to check
(
a lice for n s
overlapping dates and a method to return the duration.
e r m
h V 4. Designate an initial value for each attribute (if applicable).
4. Add public mutator methods for all attributes. Do not add a mutator
method for any attribute that is marked with the property of
“frozen.”
5. If appropriate, identify any derived attributes and create accessor or
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
bl e
fe r a
an s
n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Preparation
You will use the Class diagram of the Hotel System case study that you
updated in the previous activity as the starting point for this activity.
ble
fe r a
Task – Adding Aggregation and Composition ans
n - t r
a no
has eฺ
Complete the following steps:
)
ฺ c om uiwhether
1. Review each class association and determine d aggregation or
r a cle ent G
composition would be more appropriate.
o to add
2. Refine you class diagram
@ t u dany aggregation or composition
found in step 1. a
m i s S
r h
ฺ v ฺve use t
i t e sh to
a (h ense
erm lic
h V
H ites
Activity 3: Refining the Direction of Traversal
Preparation
You will use the Class diagram of the Hotel System case study that you
updated in the previous activity as the starting point for this activity. bl e
fe r a
an s
Task – Refine the Direction of Traversal ofon-tr
Associations a n
) has eฺ
Complete the following steps:
ฺ c om uid
ctraversal t G
le n(navigation).
a
1. Identify the directionrof
o tude
2. Add association @ S
a methods.
r m h i s
ฺ v ฺve use t
i t e sh to
a (h ense
erm lic
h V
H ites
● Declare constructors.
● Annotate methods and constructors.
Preparation
ble
You will use the Class diagram of the Hotel System case study that you
fe r a
updated in the previous activity as the starting point for this activity.
ans
n - t r
n o
Task – Refine Business Methods and Constructors
s a
) ha eฺ
Complete the following steps: ฺ c om uid
a le nt G
cmethods.
1. Add or define new business r
o tude
2. Add constructors.a @ S
r m h i s
3. Annotate
ฺ v ฺvthee methods
s e t and constructors that you added in steps 1
i e
and
t sh2. to u
a (h ense
erm lic
h V
H ites
Preparation
You will use the Class diagram of the Hotel System case study that you
updated in the previous activity as the starting point for this activity.
bl e
fe r a
Task – Review Cohesion and Coupling an s
n - t r
a no
has eฺ
Complete the following steps:
1. Review your Class diagram, and m )
ฺ c o discussuiind your group whether the
diagram has high cohesion.
r a cle ent G
2. Review your Class o d discuss in your group whether the
diagram,uand
diagram has low @
a coupling.S t
r m h i s
3. Resolve
ฺ v ฺveanyuissues
s e t identified in steps 1 and 2 by modifying your
e h diagram.
sClass t o
i t
(h ens e
a lic
Verm
h
H ites
Preparation
You will use the Class diagram of the Hotel System case study that you
updated in the previous activity as the starting point for this activity. In
addition, you will use the service classes that you created in ‘‘Activity 2:
Creating a Communication Diagram’’ on page L8-3 and ‘‘Activity 4: ble
Creating a Sequence Diagram’’ on page L8-5 of this workbook to specify
fe r a
names for the interfaces.
ans
n - t r
a no
Task – Define Components and Interfaces
) has eฺ
ฺ c om uid
Complete the following steps:
r a cle ent G
1. Create components forothe different
a @ Stud areas of common functionality.
e r m this
Note – For h ฺ vฺv uinsethe lending library system, we created the
example,
i t e s andtoBookInventory components.
a (h ense
Membership
Processes
Objectives e
r a bl
sfe
Upon completion of these activities, you should be able to:
- t r an
●
no
Describe two characteristics of common methodologies n
a
●
) has eฺ
Define the five object-oriented methodologies
● Develop an iteration plan
ฺ c om uid
Select the appropriate a cle ent for
methodology
G case studies
●
r
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
14-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Identifying Methodology Characteristics
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
v ฺ v
a. ___ hฺ Focus on
s t o usrelationships between actors and the system
h it e e on the notion that software performs activities for
a (
b. ___
e n sBased
e rm lic users
h V c. ___ Uses non-functional requirements to drive the architecture
e s
Hit of the system
d. ___ Must be iterative
e. ___ Focus on the systemic qualities, such as reliability and
scalability
Term Definition
Preparation
No special preparation is required for this activity.
Tasks ble
fe r a
ans
Complete the following steps:
n - t r
1. no
Re-assess the priorities and risks for the Use Case form that you
a
workbook. ) has eฺ
created in ‘‘Activity 2: Creating Use Case Forms’’ on page L4-4 of this
c o m uid
2. Assess the priorities and risksle ฺ G
r
discovered in ‘‘Activity 3: a c for thenremaining
Refiningethe
tUse use cases that you
Case Diagram’’ on
page L3-7 of this a @o Stud
workbook.
e r s
m thisignificance
3. Assess the
ฺ v ฺv use
architectural of each use case.
Preparation
No special preparation is required for this activity.
Tasks bl e
fe r a
an s
Complete the following steps:
n - t r
1. Read the following scenarios.
a no
2. Select and justify the methodology that
) haissappropriate
ฺ for each case
study. Note: there can be more o
ฺ c than ide
m oneumethodology for a scenario.
r a cle ent G
ACME Insurance Case
a @o Study S tud
e r t h is (AIC) wants to create a system for entering
mCorporation
h
and storingฺ vฺvinsurance
ACME Insurance
u se policies for its over 200,000 world-wide customers.
i t e shas a small
t o development team of 4 people who will work on this
AIC
(hproject, s e
nconsisting
r m a l i c e of one project manager (who also writes
Ve documentation) and three engineers. The project manager has been asked
h
ites
to keep documentation on all phases of the project using the newest
International Standards Organization (ISO) documentation process.
H
Methodology Selection ________________
Justification _________________________________________
_________________________________________________
_________________________________________________
NoLycra.com has become known for its unique jersey designs featuring
bright colors and non-traditional fabrics. NoLycra.com has recently hired
two computer engineers from a rival company to create an inventory
control system that tracks its customer’s orders and its inventory levels.
These engineers were recruited by NoLycra.com because they had created
an inventory control system at their previous company to help get
products quickly to market.
ble
Methodology Selection ________________ fe r a
a n s
Justification _________________________________________ n-t
r
a no
_________________________________________________
) has eฺ
c o m uid
ฺ
r a cle ent G
_________________________________________________
o tud
Bravo Case Studyma@ is S
ฺ v er e th
A contractor
s h ฺvhas beenushired by Bravo software to do analysis and design
e
it eXtensible
for an t o
e Markup Language (XML)-based system that can store
( h
asolutions n s
r m l i c eto common technical support issues. The contractor will be
Ve working with a small team of employees to design and implement the
h
ites
system. Most of these employees have technical experience (including
technical writing, engineering, testing, and graphical abilities), but they
H were hired as Technical Support Analysts (TSAs). One of the TSAs
suggests that the team use Rational Rose to help with the project because
Bravo owns a license to this product. The same TSA also reminds the
team that they must follow the Product Life Cycle process when
developing and delivering the new system.
Justification _________________________________________
_________________________________________________
_________________________________________________
Overview of Frameworks
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Objectives
bl e
Upon completion of these activities, you should be able to:
fe r a
Create a high level conceptual class diagram showing the classes and an s
●
interfaces that would be required for a generic framework subsystem n - t r
n o
a
Discover potential domain neutral frameworks that could be shared
has eฺ
●
across business domains )
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
15-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Activity 1: Creating a Conceptual Framework
framework
● Identify the specific domain classes that could use the framework
● Create a conceptual class diagram for the classes and relationships
that were identified
Preparation ble
fe r a
ans
No special preparation is required for this activity.
n - t r
a no
Tasks ) has eฺ
ฺ c om uid
Complete the following steps: cle n t G
r a e
owouldtubedrequired
1. Identify the classes @
aallocation
that Ssystem, wheretoresources
build a framework for
e r
a generic resource m t h i s are allocated
ฺ v
ฺv of utime.
for a period s e
e s h t o
2. hitDraw a highe level class diagram showing the generic classes and
(
a linterfacesn s
e that would be required for the framework identified in
e r m i c
step 1.
h V
H ites 3. Draw domain specific classes that could use the framework that was
created in step 2.
Preparation
No special preparation is required for this activity.
Tasks bl e
fe r a
an s
Complete the following steps:
n - t r
1. no
Identify potential frameworks that could be shared, by the following
a
System. ) has eฺ
applications: Hotel System, Car Rental System, and Private Hospital
c o m uid
2. Identify other applicationsle ฺ tG
in step 1. r a c that ecould
n
use the frameworks discovered
@theo tud
3. Optionally,m a
model
i s S
frameworks identified in step 1, and model the
r
e ofethose h
t frameworks.
ฺ v ฺvuses
specific
s
i t e sh to u
a (h ense
erm lic
h V
H ites
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Lab 16
Course Review
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
bl e
fe r a
an s
n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
16-1
Copyright 2010 Sun Microsystems, Inc. All Rights Reserved. Sun Learning Services, Revision E
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
a no
Object-Oriented ) has Analysis
e ฺ and
Design c o m
Using id
UML
u
e ฺ G
r a cl ent
@ o tud
Solutions to Labs
r m a is S
ฺ v e e th
v
hฺ to us
it e s
a ( h
e n se
erm lic
h V
H ites
D61808BP21
Edition 2.1
June 2011
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e
Table of Contents
Solutions to Lab 1: Examining Object-Oriented concepts and Terminology 3
Activity 1: Using Abstraction 3
Activity 2: Using Inheritance 4
Activity 3: Using Delegation and Cohesion 5
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Page 1 of 83
Activity 2: Applying the Strategy Pattern 54
Activity 3: Applying the Observer Pattern 55
Activity 4: Applying the State Pattern 56
Solutions to Lab 11: Introducing Architectural Concepts and Diagrams 57
Activity 1: Identifying Tiers, Layers, and Systemic Qualities 57
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Page 2 of 83
Activity 1: Using Abstraction
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Car Car
- actualSalePrice - currentSpeed
- make - maximumSpeed
ble
- model - positionOnTrack
fe r a
- purchasePrice
+ accelerate() ans
- requestedSalePrice
+ brake() n - t r
+ getProfit() n o
a
has eฺ
+ reducePrice()
+ sold() )
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
c) Vehicle Licensing
i t e s t o
(h ens
Registration Context e
rm a lic
V e Car
- s h
carbonDioxideEmissions
H ite
- make Note 1: These are just some possible
- model attributes and methods. You might have
- registrationPlate chosen other attributes and methods.
- status
- vehicleIDNumber Note 2: Some of these attributes can be
moved to another class. For example,
+ declareAsNotUsedOnPublicHighway() carbonDioxideEmissions, make, and model
+ registerAsScrapped() can be moved to a CarType class.
+ relicence()
Page 3 of 83
Activity 2: Using Inheritance
ble
fe r a
SavingsAccount CheckingAccount n
LoanAccount
a s
- overdraftLimit: Money
t r
- debited:n-boolean
+ debit(Money)
n o
+ debit(Money) +s a credit(Money)
) ha+ edebit(Money)
ฺ
o m i d
l e ฺc t Gu
o rac udencredit( amt : Money )
a @ St
e r m this if amt plus returned value of
Page 4 of 83
Activity 3: Using Delegation and Cohesion
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Branch Bank
- banchCodeIdentifier: BranchCode 1..* - bankName: String
ble
fe r a
ans
Address
n - t r
-
-
building: String
City: String a no
- Street: String
) has eฺ
-
om uid Customer
ZipCode: String
ฺ c
r a cle ent G - name: String
0..*
a @o Stud
e r m this
Account
ฺ v se
vฺ1..*
- accountNumber: Strings h t o u
- balance: Moneyite
a (h ense
rm
+ credit(Money)
e lic
V
+ debit(Money)
+ hgetBalance() : Money
ite s
H
BusinessCustomer PersonalCustomer
- companyRegistrationNumber: String - taxReferenceNumber: TaxCode
Note 1:
This is just one possible solution.
Note 2:
The Address class would normally be a utility class shown as an attribute of type
Address in the Customer and Branch classes.
Page 5 of 83
Activity 4: Understanding the Benefits of Using Interfaces
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
«interface»
TradingService e
GenericTradingSoftware uses
+ buy() r a bl
s fe
+ sell()
- t r an
no n
a
PropertyTradingService
) has eฺ
+ buy()
ฺ c om uid
+ sell()
r a n tG
cle eStockMarketShareTradingService
a @o Stud + buy()
buy() and sell() e r m this + sell()
ฺv ฺ v e
These methods implement specific
s h t o us
PropertyTrading behaviorit e
a ( h
e n se
e rm lic
h V VehicleTradingService
buy() and sell()
i t es These methods implement specific
H + buy() StockMarketShare behavior
+ sell()
Page 6 of 83
Activity 5: Defining Object-Oriented Terminology
✓ definitions.
Term Definition
i t e sh to system.
a (h ense
encapsulation The ability to determine the actual method called
Answers: abstraction, inheritance, class, encapsulation, object link, cohesion, polymorphism, object,
delegation, association, coupling
Page 7 of 83
Activity 1: Defining Workflows
✓
Term Definition
Page 8 of 83
Activity 2: Identifying Characteristics of the Requirements Gathering Workflow
Page 9 of 83
Activity 3: Identifying Characteristics of the Requirements Analysis Workflow
r a cle ent G
Answers: b, d.
o tud
is @
Answer a is wrong because this activity a part of the S
Requirements Gathering workflow.
●
r m h i s
● Answer c is wrong because this
ฺ v ฺ veis the purpose
s e t of the Design workflow.
●
sh Deployment
Answer e is wrong because
t o u diagrams are created later in the process.
i t e
a (h ense
e rm lic
h V
ite s
H
Page 10 of 83
Activity 4: Identifying Characteristics of the Architecture Workflow
o rac uden
Answers: a, b, c.
a @ St
Answer d is wrong because e
m thithe
therfocus during
s Architecture workflow is on NFRs, not FRs.
vฺvthe Design
●
Answer e is wrong h ฺ
because u semodel is refined later in the process.
●
i t e s t o
(h ens e
rm a lic
e
es hV
H i t
Page 11 of 83
Activity 5: Identifying Characteristics of the Design Workflow
s h ฺ
i t e e t o
a (h ens
e rm lic
h V
ite s
H
Page 12 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
h Ve
es
Hit
Page 13 of 83
Activity 7: Identifying the Benefits of Modeling Software
✓ the lecture.
a. ___ Models give you only a starting point for a new system.
b. ___ Models help you only to understand what you have
developed.
c. ___ Models help you visualize new or existing systems. ble
fe r a
d. ___ Models are a concrete realization of a system.
a n s
e. ___ Models help you communicate decisions to project n -t r
n o
stakeholders.
a
) has eฺ
Answers: c, e.
ฺ c om uid
●
prototype might). r a c e enpartt ofGthe system (such as a
Answer a is wrong because models are not intended tolbecome
@
Answer b is wrong because models are meant
oto help youtuunderstand
d what you will develop (not what
●
a s S
erm thinot concrete.
has already been developed).
ฺ v
Answer d is wrong because models
ฺv e
are abstract,
us
●
e s h t o
( h it se
a e n
e rm lic
h V
e s
Hit
Page 14 of 83
Activity 8: Identifying Diagram Types
Self-Check – Match the UML diagram with its description of the diagram
✓ type.
es h
H i t Component Represents a collection of physical software components
and their interrelationships
Deployment Represents the set of states that an object might experience
along with triggers that transition the object from one
state to another
Package Represents a time-oriented perspective of an object
communication
Interaction Represents a runtime snapshot of software objects and
Overview their interrelationships
Timing Represents extensions to standard diagrams
Composite Structure Represents the set of high-level behaviors that the system
must perform for a given actor
Page 15 of 83
Activity 8: Identifying Diagram Types
interrelationships
Answers: Timing, Activity, Deployment, Interaction Overview, Communication, Composite Structure, Package,
Component, State Machine, Sequence, Object, Profile, Use Case, Class
ble
fe r a
ans
n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Page 16 of 83
Activity 1: Identifying Use Case Symbols
Self-Check – Write the name of each Use Case diagram symbol in the
ites
Annotation
H
Association
Page 17 of 83
Activity 2: Creating a Use Case Diagram
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Add Charge to
Customer's Bill Daily
Waiter Generate
Invoices «actor,system»
Email System
Page 18 of 83
Activity 3: Refining the Use Case Diagram
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Hotel: Finance
ble
fe r a
ans
n - t r
Adjust
no
Customer's a
Bill
) has eฺ
ฺ c om uid
r a cle ent G
Night Auditor a @o Discrepancy
S tud
Generate
e r m this Report
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Page 19 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Register
Adjust
Customer
Customer's
Loyalty Card
Bill
bl e
fe r a
a n s
Check In condition: card payment
n r
-t required
extension points:
n oPayment Guarantee
Receptionist extension points: a
Payment Guarantee
) has eฺ
ฺ c om uid
cle «extend»
n t G
«include» o r a d e «actor,system»
a @ S t u Electronic Payment
e
Changerm thi s System
ฺ v
Roomฺ v s
Phone e Perform
Page 20 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
Hotel: Housekeeping fe r a
ans
n - t r
no
a
Request ) haofs eฺ
List
ฺ c omRooms
Vacated
u id
e
cl ent G
Housekeeper r a
a @o Stud
e r m this Mark Room as
h ฺ vฺv use Ready for Use
s
ite se t o
( h
a licen
e r m
h V
H ites
Page 21 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
Hotel: Marketing fe r a
ans
n - t r
Create
Promotion a no
) has eฺ
Modify om id
e ฺ c G u
r a cl ent
Promotion
@ o tud
m a i
Retrieve s S
r h
ฺ v ฺve uReservation
s et
Marketing
i t e sh to Statistics
a (h ense
e rm lic
es hV Publish Special «actor,system»
Page 22 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
fe r a
an s
n - t r
a no
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o «actor,syste...
( h n s e Notify Guest of Text System
r m a lice Today's
Ve Reservation
h
H ites Morning
Reservation
Notification
Page 23 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Marketing Actors
+ Booking Agent e
+ Create Promotion
+ Manage Promotions + Daily
r a bl
+ Modify Promotion + Electronic Payment System
s fe
+ Publish Special Promotion to Customers + Email System
- t r an
+ Retrieve Reservation Statistics + Housekeeper
no n
+ Loyalty Points System
a
has eฺ
+ Marketing
)
+ Morning Reservation Notification
Front Desk ฺ c om uid
+ Night Auditor
Page 24 of 83
Activity 1: Examining Use Case Scenarios
The following are some sample scenarios. However, the lab activity required you to only
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
provide summaries.
Primary Scenario 1
The customer arrives at the hotel and is greeted by the receptionist. The customer informs the
receptionist that they have a reservation. The receptionist asks for either the reservation
number or customer name. The customer provides the reservation number. The receptionist
selects the check-in form from the menu. The receptionist enters the reservation number. The
system finds the requested reservation. The system displays the customer name, room IDs
ble
and room types that were reserved, dates of stay, and the price. The receptionist confirms the
fe r a
details with the customer. The receptionist accepts that the rooms are correct. Payment
ans
t r
guarantee is required for further room charges. Customer provides payment guarantee. The
n -
no
system marks the reservation as Checked-In. The system marks all rooms reserved as being
a
occupied. The system creates the room keys. The system enables the telephone in all the
has eฺ
reserved rooms. The system creates the bill. The system adds the quoted charge for the
)
ฺ c om uid
rooms to the bill as a chargeable item of quoted room charge type. The system marks the bill
r a cle ent G
as allowing additional charges.
Note: In the above scenario and in all of the remaining scenarios, the text in blue indicates the
difference in the particular scenario with respect to Primary Scenario 1.
Primary Scenario 3
The customer arrives at the hotel and is greeted by the receptionist. The customer informs the
receptionist that they have a reservation. The receptionist asks for either the reservation
number or customer name. The customer provides the reservation number. The receptionist
selects the check-in form from the menu. The receptionist enters the reservation number. The
system finds the requested reservation. The system displays the customer name, room IDs
and room types that were reserved, dates of stay, and the price. The receptionist confirms the
details with the customer. The receptionist accepts that the rooms are correct. No further
payment guarantee is required for further room charges. The system marks the reservation as
Page 25 of 83
Checked-In. The system marks all rooms reserved as being occupied. The system creates the
room keys. The system enables the telephone in all the reserved rooms. The system creates
the bill. The system adds the quoted charge for the rooms to the bill as a chargeable item of
quoted room charge type. The system marks the bill as allowing additional charges.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Primary Scenario 4
The customer arrives at the hotel and is greeted by the receptionist. The customer informs the
receptionist that they have a reservation. The receptionist asks for either the reservation
number or customer name. The customer provides the name. The receptionist selects the
check-in form from the menu. The receptionist enters the customer’s name. The system finds
only one matching reservation. The system displays the customer name, room IDs and room
types that were reserved, dates of stay, and the price. The receptionist confirms the details ble
with the customer. The receptionist accepts that the rooms are correct. Payment guarantee is
fe r a
an
required for further room charges. Customer provides payment guarantee. The system markss
- t r
the reservation as Checked-In. The system marks all rooms reserved as being occupied. The
n
no
system creates the room keys. The system enables the telephone in all the reserved rooms.
a
) has eฺ
The system creates the bill. The system adds the quoted charge for the rooms to the bill as a
chargeable item of quoted room charge type. The system marks the bill as allowing additional
charges. ฺ c om uid
r a cle ent G
Primary Scenario 5
The customer arrives at the hotel andm
@o Sthe
isagreetedsby
tudreceptionist. The customer informs the
receptionist that they have a reservation.
i
er eThethreceptionist asks for either the reservation
ฺ ฺ v
v customers
number or customer name.hThe
s t o u provides the name. The receptionist selects the
e
three matching a (hit menu.
check-in form from the
reservations.e n sThe
e receptionist enters the customer’s name. The system finds
The system displays a summary of each reservation. The
customere r m l i c
The h V confirms
system
which reservation is theirs. The receptionist selects the valid reservation.
displays the customer name, room IDs and room types that were reserved, dates
i t esstay, and the price. The receptionist confirms the details with the customer. The receptionist
of
H accepts that the rooms are correct. Payment guarantee is required for further room charges.
Customer provides payment guarantee. The system marks the reservation as Checked-In.
The system marks all rooms reserved as being occupied. The system creates the room keys.
The system enables the telephone in all the reserved rooms. The system creates the bill. The
system adds the quoted charge for the rooms to the bill as a chargeable item of quoted room
charge type. The system marks the bill as allowing additional charges.
Secondary Scenario 1
The customer arrives at the hotel and is greeted by the receptionist. The customer informs the
receptionist that they have a reservation. The receptionist asks for either the reservation
number or customer name. The customer provides the reservation number. The receptionist
selects the check-in form from the menu. The receptionist enters the reservation number. The
system finds the requested reservation. The system displays the customer name, room IDs
and room types that were reserved, dates of stay, and the price. The receptionist confirms the
details with the customer. The receptionist rejects that the rooms are correct. The receptionist
restarts the check-in process.
Page 26 of 83
Secondary Scenario 2
The customer arrives at the hotel and is greeted by the receptionist. The customer informs the
receptionist that they have a reservation. The receptionist asks for either the reservation
number or customer name. The customer provides the name. The receptionist selects the
check-in form from the menu. The receptionist enters the customer’s name. The system finds
three matching reservations. The system displays a summary of each reservation. The
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
customer confirms which reservation is theirs. The receptionist cannot find a valid reservation.
The receptionist restarts the check-in process.
ble
fe r a
ans
n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Page 27 of 83
Activity 2: Creating Use Case Forms
Page 28 of 83
the valid reservation, go to step 2.2 [A4]
A4: Receptionist enters that none of the reservations were valid, go
to step 2
A5: Receptionist doesn’t accept that rooms are correct, go to step
2.3
A6: No payment guarantee for additional charges, marks bill as not
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Page 29 of 83
Abstract of Supplementary Specification Document
NFR32: The System must support 6 simultaneous check-in operations per property.
NFR33: The Check In use case must take no longer than 5 minutes to complete.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
fe r a
ans
n - t r
n o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Page 30 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
a (h stay.e n se
rm
Room Status
e licRecords the status of a room—for example, occupied, available, or
h V unserviceable.
ite s
H
Page 31 of 83
Actrivity1: Identifying Activity Diagram Symbols
ble
Design Product Activity or Action fe r a
ans
n - t r
n o
a
has eฺ
Decision or Merge
)
ฺ c om uid
cle Activity
n t G
r a
o tude Inititial
@
a is S
r m
e e th
v ฺ v
e s hฺ to us Activity Final
i t
(h ens e
a lic
Verm
h
H ites Fork
Activity Flow
Join
Page 32 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
fe r a
CheckIn
ans
Start
n - t r
Pre CheckIn Restart
a no
) has eฺ
Pre CheckIn
ฺ c om Cancel
u id Pre CheckIn
Activities e
cl ent G Activity
r a
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
( h n s
Post
e CheckIn
Notify
Ve CheckIn
h
H ites
ActivityFinal
Page 33 of 83
Receptionist System
Post
CheckIn
Start
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Change
Reservation
Status to
Checked-In
Change Status
ble
of Reserved
fe r a
Rooms to
a n s
Occupied
Includen -t r
(Create
o
n Room
Electronic
a
s Keys)
h a
Include (Change ) e ฺ
o m i d
l e ฺc t Gu
Room Telehpone
rac uden
Status)
o
@ St
r a
m this
e
h ฺ vฺv use Create Bill for Add Quoted
s
ite se t o Reservation Charge to Bill
( h
a licen
e r m
h V
H ites [Payment Guarantee for Additional
Chargeable Items]
Post
CheckIn End
Page 34 of 83
Receptionist System
Pre
[No matches]
CheckIn
Start
Notify
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Receptionist that
[Request no Matching
Reservation Number Reservation
Search] Found
[Req. Name Search]
[Rooms Accepted]
Extension Point
(Payment Guarantee)
End of Pre
CheckIn
Page 35 of 83
Activity 1: Finding Candidate Key Abstractions
Customer (actor)
Hotel
Reservation
Room e
r a bl
Payment Guarantee s fe
- t r an
Room Key
n on
a
Room Phone
) has eฺ
c o m uid
ฺ
Bill
r a cle ent G
Chargeable Item
a @o Stud
e r m this
Receptionist
h ฺ vฺv use
i t e s t o
System (h ens e
rm a lic
Rooms
V e Upgrade
e s h
Hit Assigned Rooms
Reservation Number
Customer Name
Room Id
Room Type
Dates of Stay
Price
Checked-In Status
Quoted Charge
Page 36 of 83
Additional Chargeable
Items Allowed Status
Initial Room Charge
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Customer
Basic Rate
Promotion
ble
fe r a
ans
n - t r
no
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Page 37 of 83
Activity 2: Finding Key Abstractions Using CRC
Hotel Property
Reservation Reservation
Room Room
ble
Payment Guarantee PaymentGuarantee fe r a
ans
Room Key External n - t r
a no
Room Phone External
) has eฺ
Bill ฺ c om uiBill
d
e
cl ent G
r a
Chargeable Item
a @o Stud ChargeableItem
erm e thi s
Receptionist ฺ v
Actor
ฺv
s h t o us
System h it e e system
The
(
a lice n s
Roomse r m
Upgrade Reassignment of rooms
V
esh
Hit Assigned Rooms Assignment of Room
Page 38 of 83
Additional Chargeable Attribute of Bill
Items Allowed Status
Initial Room Charge Synonym for Chargeable Item
Customer Customer
Promotion Promotion
ble
fe r a
ans
n - t r
no
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm
h
H ites
Page 39 of 83
Activity 1: Identifying Class Diagram Elements
Self-Check – Write the name of each Class diagram symbol in the space
)
ฺ c om u id label
Mulitiplicity
1..*
e
cl ent G
r a
a @o Stud
e r m this
employs
Unidirectional association
ฺv ฺ v e
s h t o us
h e
it ClassAse ClassB
(
a lice n
e r m Association class
h V
H ites ClassX
Page 40 of 83
Activity 2: Domain Model Class Diagram
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Reservation Customer
Bill arrival date made for address
has departure date first name
allowAddCharges 1 1 quoted price 1..* 1
last name
reservation number phone number
1 status
1 1..* e
assigned
r a bl
0..*
guaranteed by
allocated to n s fe
RoomType
a
-trdescription
ChargeableItem
n on
has
1
amount s a0..* 1
date
PaymentGuarantee a
) h deฺ
1..*
amount
c m
o Roomui located at
e ฺ G
0..*
r a cl room e n t id
Property
e rm li c card number
price for a
h V
e s
Hit adjusts price for a
PurchaseOrderGuarantee
po number
0..*
0..*
1..* SeasonalPriceAdjustment
provides
1 Promotion
description
end date description
Company
percentage discount offer end date
address start date offer start date
company name voucher code
telephone number calculateDiscount(Reservation)
Page 41 of 83
Activity 3: Identifying Object Diagram Symbols
Self-Check – Write the name of each Object diagram symbol in the space
) has eฺ
:Account c m uid
oObject
ฺ t Gnode
r a cle eattribute
firstName:Bryan
n
lastName:Smith
with
values
@o Stud
Amount:10.29
r a
m this
e
h ฺ vฺv use
i t e s t o
(h Self-Check e
ns – Select the statement or statements about UML Object
a c e
V✓erm i
ldiagrams that are TRUE.
es h
H i t a. ___ Object diagrams can be validated using Class
diagrams.
b. ___ Object diagrams show runtime links.
c. ___ Object symbols can have three
compartments: name, attribute, and an
operations compartment.
d. ___ Object diagrams often show object state.
e. ___ An Object diagram is an instance of a class
diagram.
Answers: b, d, e.
Page 42 of 83
Activity 4: Validating a Class Diagram
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
m ) deฺ = available
status
ฺ c o u i
e
cl ent G
r a
:Reservation a
@o Stud :RoomType
e r m= 1346901
t h is :Property
arrival h ฺ
datev=v12/23/2009
reservation ฺnumber
u se description = double room
i t e s dateto= 12/27/2009
departure
a se
(hstatuse=nconfirmed
lic price = 800
erm quoted
h V
ites
:Room
H room id = 302
status = available
Page 43 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Assume that the date is December 23, 2009 and John Smith has checked in.
He has extended his payment guarantee amount to cover additional charges.
:ChargeableItem
:ChargeableItemType
date = 12/23/2009
amount = 800 description = Quoted Room Charge
Note: During this modeling review with the client, you might discover that a
reservation can have a second payment guarantee. In that case, the Domain class
diagram as well as the Use Case forms will need to be modified.
Page 44 of 83
This is not part of the lab, but may be of interest. Assume date is 24 Dec 2009, and John
Smith and his party have a meal in the restaurant and purchase beverages twice.
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
ble
fe r a
a n s
:Reservation :RoomType
n-t r :Property
reservation number = 1346901
arrival date = 12/23/2009 no
description = double room
a
departure date = 12/27/2009
status = checked-in ) has eฺ
quoted price = 800 ฺ c om uid
r a cle ent G :Room
o t u d
r m a@ is S room id = 302
ฺ v e e th status = occupied
s h ฺv us
i t e t o :Bill
:ChargeableItem :ChargeableItemType
date = 12/23/2009 description = Quoted Room Charge
amount = 800
:ChargeableItemType
description = Beverages
Page 45 of 83
Activity 1: Identifying Collaboration Diagram Elements
ble
fe r a
ans
:Account Object node
n - t r
n o
a
) has eฺ
om uid
2.1: getAccountInfo()
Message link
ฺ c
r a cle ent G
o Createtuobject
<<create>>
@ d message
r m a is S
ฺ v e e th
v
hฺ:MainUIto us
i t e s Boundary component
(h ens e
a lic
Verm
h
H ites :AccountSvc Service component
Page 46 of 83
Activity 2: Creating a Communication Diagram
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
h ฺ vฺv :ReservationService
u se
i t e s t o 2.2.6.1: price
res
2.2.7: <<create>>(price,type)
( h s e 2.2.6: getQuotedPrice
r m a licen :Reservation
h Ve
H ites 2.2.3: *occupied
2.2.5: <create>>
:ChargeableItem
2.2.10: [Payment Guarantee for Additional Item]:chargeAllowed
2.2.8: addChargeableItem
:Room
b :Bill
Key:
frag ICRPS : frag Include Change Room Phone Status
Page 47 of 83
Activity 3: Identifying Sequence Diagram Elements
Actor node
ble
Customer fe r a
ans
n - t r
:Account n Object node o
a
) has eฺ
ฺ c om uid
r a cle ent G
a @o StudActivation bar
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
Verm Lifeline
h
H ites Return arrow
message()
Message arrow
Page 48 of 83
Activity 4: Creating a Sequence Diagram
res :Room
:Reservation
Receptionist :CheckInUI :
enter(resNum) ReservationService
findReservation(resNum)
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
res
ble
seq frag Payment Guarantee
fe r a
acceptCheckIn
ans
n - t r
checkedIn
a no
getRooms
) has eฺ
roomList
ฺ c om uid
loop a cle ent G
occupied
r
[foreach room in
o tud
@roomList]
m a i s S
r
ve Include t h
ฺ v ฺfrag s e
e s h to u
seq Create Room Keys
( h it se
a c e n <<create>> b :Bill
e r m l i
h V getQuotedPrice
H ites price
<<create>>(price,type) c
:ChargeableItem
addChargeableItem(c)
opt
[Payment Guarantee for Additional Items]
seq frag Include (Change Room Phone Status)
chargeAllowed
complete
reservation complete
Note 1: The Include (Change Room Phone Status) could have been an extend
stereotype due to its optional nature.
Note 2: The Include (Change Room Phone Status) was moved from being
earlier in the sequence so it could share the optional fragment.
Page 49 of 83
res cust :Room type :Room
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
cust
Get Reservation Details Fragment
getLastName
i t e s getRoomType
t o
(h ens e
rm a lic type
e
es hV getDescription
H i t
description
getArrivalDate
arrival date
getDepartureDate
departure date
getQuotedPrice
price
Page 50 of 83
Activity 1: Identifying State Machine Diagram Elements
ble
AcctOverdrawn State node
fe r a
ans
n - t r
n o
AcctOverdrawn
s a
State node
entry / notifyCustomer
) h awith
internal
m events eฺ
entry / doNotAllowSpending
c o
exit / allowSpending
ฺ u id
e
cl ent G
r a
o tudStart state
@
a is S
r m
e e th Stop state
v ฺ v
e s hฺ to us Transition arrow
i t
(h ens e
a lic
Verm
h
H ites
Page 51 of 83
Activity 2: Creating a State Diagram
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
&&
an
wh ot
t)
/n
r
en if
r s) ft
af
if ba ana on erd &&
n -
ge th ra
dr
(b Ma
m v 0
er
al a
/n en ify 3 = o <
y
wh
ov
a
an ge
en
has eฺ
ce r
=
/n me nce la
(b
er <
<
ti la (ba
al
ag e
=
an
om uid
an nc
ba en
ov
M
ce
yM la
ฺ c wh
er
cle ent G
>=
dr
ot (
a
af
r
0)
@o Stud
) t
r a
m this
e
h ฺ vฺv use Frozen
s
ite se t o
( h
a licen
e r m
h V
ites
Account is
closed
H Closed
Page 52 of 83
Activity 1: Applying CRP
ble
Air
fe r a
- airworthinessCertificate ans
- maxSpeed n - t r
n oNatural
a
) has eฺ
c o m uid
ฺ
Water
r a cle ent G
@o Stud
- maxSpeed
- seaworthinessCertificate
r a
m this
ฺ v e e
Tide Wind
s h ฺv us
e t o
Land(hit se
a e n
r m l ic
- landVehicleInspectionCertificate
e
V
- maxSpeed
h
ite s NuclearFuel FossilFuel
H
Note1: Terrain can be a class, in which case maxSpeed can be stored in the base class Terrain.
However, if the units of measurement are different, this might not be the best approach.
Note 2: You need subclasses of PowerSource only if each subclass has different attributes or
behaviour.
Page 53 of 83
Activity 2: Applying the Strategy Pattern
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Promotion
Hotel - end date
has
- start date
0..* - voucherCode
+ calculateDiscount(Reservation)
bl e
fe r a
ans
n - t r
a no
FreeNightWeekendOnlyOffer
) as ฺ
hPercentageDiscountOffer
+ calculateDiscount(Reservation)
ฺ c om u ide
- percentageDiscount
a @o Stud
e r m this
h ฺ vฺvFreeNightAnyTimeOffer
u se
i t e s- numberOfNightsFree
t o
e
(h e-nsnumberOfNightsToQualify
rm a lic + calculateDiscount(Reservation)
V e
e s h
Hit
Note 1: It may be possible to have FreeNightAnyTimeOffer and FreeNightWeekendOnlyOffer as the
same class or share a common FreeNightOffer class.
Note 2: CalculateDiscount is passed the Reservation object, so it can get any information it needs that
may affect whether the offer is valid for a reservation, for example the dates of the stay.
Note 3: Although the Promotion class has a voucher code, the default value could be that no voucher
is needed.
Page 54 of 83
Activity 3: Applying the Observer Pattern
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Observable «interface»
+ attach(Observer) Observer
+ detach(Observer) + update()
+ notify()
ble
fe r a
Room
ans
- roomId
n - t r
- status
a no
+ vacated()
) has eฺ
ฺ c om uid
a cle ent G
HandHeldDeviceNotification
r StatusDisplay
o
@ Stu
+ aupdate()
d + update()
vacated(): r m
e e th i s
v ฺ v
hฺ to us
status := vacated
call notify()
it e s
( h n s e update():
h Ve
H ites
update():
identify roomId
Send message that includes roomId to hand held device
Note 1:
It is possible to send an object as a parameter to the update method. This object can be the Room
object, in which case it will be easier to identify the room.
Note 2:
JavaTM uses different methods.
Page 55 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Account AcctStatus
ble
Deposit()
Withdrawl()
Deposit()
fe r a
Transfer()
Withdrawl()
Transfer()
an s
n - t r
n o
a
AcctActive AcctOverdrawn
) has eฺ
AcctFrozen AcctClosed
Deposit()
om uid
Deposit() Deposit() Deposit()
Withdrawl()
ฺ c
Withdrawl() Withdrawl() Withdrawl()
cle ent G
Transfer() Transfer() Transfer() Transfer()
r a
@o Stud
withdrawl
amount up to
currentBalance a
m this
displayMessage()
r displayMessage()
e
withdrawl
vฺv use
+ overdraftLimit
amount up to
s h ฺ currentBalance
i t e t o
+ overdraftLimit
e
a (h ens
erm lic
h V
H ites
Page 56 of 83
Activity 1: Identifying Tiers, Layers, and Systemic Qualities
✓ Layer Definition
Application Provides the APIs that application
components implement
Virtual Platform Consists of the operating system
ble
Upper Platform Includes computing components such as fe r a
servers, storage, and network devices
ans
n - t r
Lower Platform
no
Provides a concrete implementation of
a
components to satisfy the functional
has eฺ
requirements
)
Hardware
c om
Consists of
ฺ productsid
u such as web and
Platform e
cl ent
containers and G
middleware
r a
a @oPlatform,
Answers: Virtual Platform, Lower Platform, Hardware S ud Upper Platform
tApplication,
e r m this
h ฺ vฺv use
i t e s – Match
Self-Check t o the tiers with their definitions.
e
✓erma (hTierlicens
h V Definition
Page 57 of 83
Activity 1: Identifying Tiers, Layers, and Systemic Qualities
✓
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Page 58 of 83
Activity 2: Exploring Component Diagrams
<<JAR>>
) has eฺ
c omiconuid
Interface
ฺ
r a cle ent G
*o
a @ S tud
e r m this Executable file component
h ฺ vฺv use
i t e s t o
(h ens e *
a c
Verm li
DBMS component
h
ites
DBMS
H
DrawApp
*
Application component
Page 59 of 83
Activity 2: Exploring Component Diagrams
)
ฺ c om uid
r a cle ent G
a @o Stud
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
rm a lic
e
es hV
H i t
Page 60 of 83
Activity 3: Understanding Deployment Diagrams
Communication link
<<FTP>>
ble
fe r a
<<JAR>> ans
n - t r
Component node o
PayrollSystemJAR
a n
) has eฺ
ฺ c om uid
PC
cleHardware
n t G
r a
o tude node
@
a is S
r m
e e th
v ฺ v
e s hฺ to us
( h it s e Dependency arrow
r m a licen
Ve
h
H ites
Page 61 of 83
Activity 3: Understanding Deployment Diagrams
Page 62 of 83
Activity 4: Creating a High-Level Deployment Diagram
Travel Agent System
Customer's Electronic Payment
Machine Machine
Travel
Agency
Browser Booking Electronic
Software Card Payment
Software
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
( h it «rmi» se
a c e n «tcp/ip/intranet»
e r m l i Hotel «sql»
Database
h V «tcp/ip/intranet» Application
ite s Software
H
«wifi/IEEE 802.11»
«wifi/IEEE 802.11»
«soap»
«device» «soap»
Department Display Screens «tcp/ip/intranet» «soap»
«soap»
Display «device»
Software «soap» «soap»
Hand Held Device
Page 63 of 83
Activity 1: Update and Extend a Tiers and Layers diagram
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
m a S Java SE 6 Java SE 6
r
ฺ v ฺve
s h
( h ite
a
V erm Solaris 10 Solaris 10
LP hAny OS Solaris 10
Page 64 of 83
Activity 2: Create DAOFactory and DAO Classes
«interface»
ReservationDAO
+ create(Reservation)
+ delete(Reservation)
+ retrieve(ReservationNumber) : Reservation
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
+ update(Reservation)
ReservationDAO_RDBMS ReservationDAOWebService
+ create(Reservation) + create(Reservation)
+ delete(Reservation) e
+
+
delete(Reservation)
retrieve(ReservationNumber) : Reservation + retrieve(ReservationNumber) : Reservation
r a bl
+ update(Reservation) + update(Reservation)
s fe
- t r an
no n
a
«interface»
CustomerDAO ) has eฺ
+ create(Customer) ฺ c om uid
+ delete(Customer)
r a cle ent G
a @o Stud : Customer
+ retrieve(CustomerNumber)
+ update(Customer)
e r m this
h ฺ vฺv use
i t e s t o
(h ens e
a lic
CustomerDAO_RDBMS
+
erm
Vcreate(Customer)
CustomerDAO_WebService
s h + create(Customer)
H ite + delete(Customer)
+ retrieve(CustomerNumber) : Customer
+
+
delete(Customer)
retrieve(CustomerNumber) : Customer
+ update(Customer) + update(Customer)
«interface»
DAOFactory
+ makeCustomerDAO() : CustomerDAO
+ makeReservationDAO() : ReservationDAO
DAOFactory_RDBMS DAOFactory_WebService
+ makeCustomerDAO() : CustomerDAO + makeCustomerDAO() : CustomerDAO
+ makeReservationDAO() : ReservationDAO + makeReservationDAO() : ReservationDAO
Page 65 of 83
Activity 1: Refining Attributes
provides
1..*
CardPaymentGuarantee
PurchaseOrderGuarantee
+ cardNumber: CardNumber {readOnly}
- poNumber: PurchaseOrderNumber
+ getCardNumber() : CardNumber
Page 66 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
DateRange
- endDate: Date
ble
- startDate: Date
fe r a
+ getDaysDuration() : int ans
+ getDaysGap(secondDateRange :DateRange) : int n - t r
+ n
getDaysOverlap(secondDateRange :DateRange) : int o
a
has eฺ
+ getEndDate() : Date
+ getStartDate() : Date )
+ om uid
isDateRangeContained(secondDateRange :DateRange) : boolean
ฺ c
+
+ r a cle ent G
isGap(secondDateRange :DateRange) : boolean
isOverlap(secondDaterange :DateRange) : boolean
+ @o Stud
setDurationEndDates(endDate :Date, duration :int)
a
+ m this
setStartDurationDates(duration :int, startDate :Date)
e r
vฺv use
+ setStartEndDates(endDate :Date, startDate :Date)
s h ฺ
i t e e t o
a (h ens
erm lic
h V Note 1: The solution shows only a subset of methods that will be useful in the
Note 2: You can also have class (static) methods for many of these methods.
Page 67 of 83
Bill Customer
RoomType
- allowAddCharges: boolean - address: Address
- /total: Money - description: String - firstName: String {readOnly}
- lastName: String {readOnly}
+ canChargesBeAdded() : boolean 1 - phoneNumber: PhoneNumber
+ getTotal() : Money
+ getLastName() : String
1 has
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
0..* 1
1
assigned Room
- roomId: RoomId
- status: RoomStatus
has
0..* + getRoomId() : RoomId
+ setRoomId(roomId :RoomId)
ChargeableItem made for
ble
- amount: Money
1..*
fe r a
- date: Date {readOnly}
ans
allocated to n - t r
+ getAmount() : Money
n o
+ getDate() : Date
1 1..* s a
) ha eฺ 1..*
0..*
c m uid
oReservation
ฺ tG
describes r a cle eDateRange
- datesOfStay: n
o tudMoney
- quotedPrice:
@
m a s S
- reservationNumber:
i ReservationNumber
v r
e et - h
status: ReservationStatus = new
1
v ฺ
e s hฺ to us + checkedIn()
( h it
ChargeableItemType
s e + confirmed()
a lice
- description: String n + getDatesOfStay() : DateRange
e r m + getQuotedPrice() : Money
V
+ getDescription() : String
+h setDescription(desc :String)
+ getReservationNumber() : ReservationNumber
ite s + held()
H
1
guaranteed by
1
PaymentGuarantee
PurchaseOrderGuarantee - amount: Money
- poNumber: PurchaseOrderNumber
+ getAmount() : Money
+ setAmount(amt :Money)
1..*
CardPaymentGuarantee
+ cardNumber: CardNumber {readOnly}
provides
+ getCardNumber() : CardNumber
1
Company
Note 1: Only a sample of the possible attribute definitions,
- address: Address accessor methods, and mutator methods have been provided.
- companyName: String Note 2: This is just one possible interpretation of aggregation
- telephoneNumber: PhoneNumber and composition.
Page 68 of 83
Activity 3: Refining the Direction of Traversal
RoomType Room
- description: String - roomId: RoomId
has - status: RoomStatus
+ addRoom(room :Room)
+ deleteRoom(res :Reservation) 1 0..* + addReservation(res :Reservation) : void
+ findRooms() : List<Room> + getReservations() : List<Reservation>
+ removeReservation(res :Reservation) : RoomId
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
+ setRoomId(roomId :RoomId)
1..*
Customer
- address: Address
- firstName: String {readOnly} allocated to
- lastName: String {readOnly}
- phoneNumber: PhoneNumber
ble
+ addReservation(res :Reservation) made for
fe r a
+ getLastName() : String
1
1..*
an s
1..*
n - t r
a no
Reservation
- datesOfStay: DateRange
) h as ฺ
ฺ c
- reservationNumber: u ide
omReservationNumber
- quotedPrice: Money
- status: c
a le nt G = new
ReservationStatus
PaymentGuarantee
+@
r
o tude:Room)
addRoom(room
- amount: Money
m i s S
a+ changeRoom(oldRoom :Room, newRoom :Room)
e r + t h
v s+e confirmed()
checkedIn()
1 vฺ
+ getAmount() : Money
+ setAmount(amt :Money) hฺ 1 u + getDatesOfStay() : DateRange
i t e s t o
a n se by ++ getPaymentGuarantee()
(h eguaranteed getQuotedPrice() : Money
: PaymentGuarantee
+ getCompany() : Company
has
provides 1..*
1
Company
- address: Address
- companyName: String
- telephoneNumber: PhoneNumber
Page 69 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Bill
- allowAddCharges: boolean
- /total: Money ble
fe r a
+ addChargeableItem(item :ChargeableItem)
ans
+ canChargesBeAdded() : boolean
n - t r
+ o
deleteChargeableItem(item :ChargeableItem)
n
+ a
getChargeableItems() : List<ChargeableItem>
+ has eฺ
getTotal() : Money
)
ฺ c om uid
ChargeableItemType
r a cle ent G1
- description: String
a @o Stud
+ getDescription() : String erm t h is
h ฺ vฺv use
+ setDescription(desc :String)
i t e s 1 to
a (h ense assigned
rm li c
h Ve
i t es describes
H
0..*
0..*
ChargeableItem
- amount: Money
- date: Date {readOnly}
+ getAmount() : Money
+ getChargeableItemType() : ChargeableItemType
+ getDate() : Date
+ setChargeableItemType(t :ChargeableItemType)
Page 70 of 83
Activity 4: Refining Business Methods and Constructors
Room
RoomType - roomId: RoomId
- status: RoomStatus
- description: String
has
+ addReservation(res :Reservation) : void
+ addRoom(room :Room)
+ deleteRoom(res :Reservation) 1 0..* + getReservations() : List<Reservation>
+ removeReservation(res :Reservation) : RoomId
+ findRooms() : List<Room>
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
1 a no
made for ) h as ฺ
Reservation
c
1..* - quotedPrice: Money
ฺ om uide
- datesOfStay: DateRange
- reservationNumber:
r a t G= new
cle enReservationNumber
PaymentGuarantee @ o tud
- status: ReservationStatus
m a
+ S :Room)
addRoom(room
i s
- amount: Money
v r + t h
e + echeckedIn()
changeRoom(oldRoom :Room, newRoom :Room)
v ฺ
+ getAmount() : Money
e s hฺ1 to us+ confirmed()
( h it
+ setAmount(amt :Money)
s e 1 by ++ getDatesOfStay() : DateRange
a lice n
guaranteed getPaymentGuarantee() : PaymentGuarantee
r m + getQuotedPrice() : Money
h Ve + getReservationNumber() : ReservationNumber
ites
+ held()
+ Reservation(dates :DateRange, rtr :List<RoomTypes>)
H + setPaymentGuarantee(pg :PaymentGuarantee)
CardPaymentGuarantee
1
+ cardNumber: CardNumber {readOnly}
+ getCardNumber() : CardNumber checkedIn:
if status != confirmed
then
throw InvalidChangeOfStateException
PurchaseOrderGuarantee else
- poNumber: PurchaseOrderNumber set status = checkedIn
+ getCompany() : Company
has
1..* Note: The solution contains
provides
only a sample of the
1
constructors and the method
Company annotations that could have
been discovered.
- address: Address
- companyName: String
- telephoneNumber: PhoneNumber
Page 71 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
1
getTotal:
set total := 0 Bill
foreach ChageableItem - allowAddCharges: boolean
call getPrice and add to - /total: Money ble
total
fe r a
return total + addChargeableItem(item :ChargeableItem)
an s
+ Bill(initalCharge :ChargeableItem)
n - t r
+
+
canChargesBeAdded() : boolean
a no
deleteChargeableItem(item :ChargeableItem)
+
+ )
getTotal() : Money
has eฺ
getChargeableItems() : List<ChargeableItem>
ฺ c om uid
ChargeableItemType
r a cle1 ent G
- description: String
a @o Stud addChargeableItem:
if allowAddCharges = false
r
+ ChargeableItemType(descr :String)m
e et h i s then
+ getDescription() : String vฺv
h ฺ u s throw CannotChargeException
s
+ setDescription(desc :String)
ite se1 t o assigned else
0..*
0..*
ChargeableItem
- amount: Money
- date: Date {readOnly}
+ ChargeableItem(amt :Money, date :Date, itemType :ChargeableItemType)
+ getAmount() : Money
+ getChargeableItemType() : ChargeableItemType
+ getDate() : Date
+ setChargeableItemType(t :ChargeableItemType)
Page 72 of 83
Activity 5: Checking your Class Diagram for High Cohesion and Low Coupling
Room
RoomType - roomId: RoomId
- status: RoomStatus
- description: String
has
+ addReservation(res :Reservation) : void
+ addRoom(room :Room)
+ deleteRoom(res :Reservation) 1 0..* + getReservations() : List<Reservation>
+ removeReservation(res :Reservation) : RoomId
+ findRooms() : List<Room>
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
1 a no
made for ) h as ฺ
Reservation
c
1..* - quotedPrice: Money
ฺ om uide
- datesOfStay: DateRange
- reservationNumber:
r a t G= new
cle enReservationNumber
PaymentGuarantee @ o tud
- status: ReservationStatus
m a
+ S :Room)
addRoom(room
i s
- amount: Money
v r + t h
e + echeckedIn()
changeRoom(oldRoom :Room, newRoom :Room)
v ฺ
+ getAmount() : Money
e s hฺ1 to us+ confirmed()
( h it
+ setAmount(amt :Money)
s e 1 by ++ getDatesOfStay() : DateRange
a lice n
guaranteed getPaymentGuarantee() : PaymentGuarantee
r m + getQuotedPrice() : Money
h Ve + getReservationNumber() : ReservationNumber
ites
+ held()
+ Reservation(dates :DateRange, rtr :List<RoomTypes>)
H + setPaymentGuarantee(pg :PaymentGuarantee)
CardPaymentGuarantee
1
+ cardNumber: CardNumber {readOnly}
+ getCardNumber() : CardNumber checkedIn:
if status != confirmed
then
throw InvalidChangeOfStateException
PurchaseOrderGuarantee else
- poNumber: PurchaseOrderNumber set status = checkedIn
+ getCompany() : Company
has
Note 1: This diagram has optimum
1..* cohesion.
provides
1 Note 2: This diagram has more than
optimum coupling because of the
Company bidirectional association. For
Example, there is bidirectional
- address: Address association between Room and
- companyName: String Reservation, RoomType and Room,
- telephoneNumber: PhoneNumber and Customer and Reservation.
Page 73 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
1
getTotal:
set total := 0 Bill
foreach ChageableItem - allowAddCharges: boolean
call getPrice and add to - /total: Money ble
total
fe r a
return total + addChargeableItem(item :ChargeableItem)
an s
+ Bill(initalCharge :ChargeableItem)
n - t r
+
+
canChargesBeAdded() : boolean
a no
deleteChargeableItem(item :ChargeableItem)
+
+ )
getTotal() : Money
has eฺ
getChargeableItems() : List<ChargeableItem>
ฺ c om uid
ChargeableItemType
r a cle1 ent G
- description: String
a @o Stud addChargeableItem:
if allowAddCharges = false
r
+ ChargeableItemType(descr :String)m
e et h i s then
+ getDescription() : String vฺv
h ฺ u s throw CannotChargeException
s
+ setDescription(desc :String)
ite se1 t o assigned else
0..*
0..*
ChargeableItem
- amount: Money
- date: Date {readOnly}
+ ChargeableItem(amt :Money, date :Date, itemType :ChargeableItemType)
+ getAmount() : Money
+ getChargeableItemType() : ChargeableItemType
+ getDate() : Date
+ setChargeableItemType(t :ChargeableItemType)
Page 74 of 83
Activity 6: Creating Components with Interfaces
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
RoomPhoneControl
RoomPhoneControlService
ReservationService
RoomPhoneControlService
ble
fe r a
Customer ReservationService Reservation
ans
AdditonalCharges
n - t r
n o
a
has eฺ
BillingService RoomService
)
ฺ c
BillingServiceom uid
BillingService
r a cle ent G
a @o Stud
e r
Billing
m this
h ฺ vฺv use
i t e s t o
(h ens e
rm a lic
V e
es h Housekeeping
RoomService
H i t RoomService
Room
Page 75 of 83
Activity 1: Identifying Methodology Characteristics
Page 76 of 83
Activity 1: Identifying Methodology Characteristics
Page 77 of 83
Activity 2: Defining the Five Object-Oriented Methodologies
Term Definition
ble
fe r a
Waterfall An iterative software development process,
ans
created by Booch, Jacobson, and Rumbaugh, that
is freely available for use. n - t r
a no
eXtreme Programming
) hakeys activities
Coding and testing are the
e ฺ within
this methodology. m id
(XP)
ฺ c o u
e
cl ent G
Unified Software r a
o tuframework,
Team-oriented d where each Sprint
Development Process @
a is S
produces a working version of the software.
(UP) r m
e e th
v ฺ v
e s hฺ to us
h it
Rational Unified Process
( s e This methodology uses a single phase in which all
(RUP) a lice n workflows proceed in a linear fashion.
r m
Ve
hScrum
i t es A commercial implementation of the UP
H methodology.
Page 78 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
t h is
Abstract of a Suggested Hotel System Iteration Plan u s e
e t o
Note: Your plan might vary as the assessment of risk and priority is subjective. e n s
c
bl e li
Elaboration Construction
f e r a
Iter#2 Iter#3 Iter#4 Iter#5 Iter#6 a n
Iter#7
s Iter#8 Iter#9
n-t r
Create Perform Perform Update Delete oRequest List of
Retrieve Publish Special
Reservation Card Payment Payment Cash Reservation
s an
Reservation Vacated Rooms Reservation Promotions to
Transaction Transaction
) ha eฺ Statistics Customers
Simulation Add Charge to Create
ฺ c omCreateuid
Identify Existing Mark Room Modify Notify Guest of
Customer Data Customer's Bill Customer Reservation
c t G
le nPromotion Ready for Use Promotion Today's
a
or tude Reservation
Check In Check Out Change Room @
a AdjustS Register Generate Generate Modify
Customer Customer Phone e r m
Status Customer's Bill Customer Nightly Reports Discrepancy Customer
ฺ v ฺv Loyalty Card Report
s h
( h ite
Simulation e rma Add Loyalty
hV
Change Room
es
Points
i t
Phone Status
H
Page 79 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Page 80 of 83
Activity 1: Creating a Conceptual Framework
«interface»
DateRange GenericDateRange
+ getDateRange(start :Date, end :Date) : Date + getDateRange(start :Date, end :Date) : Date
+ getStartDate() : Date + getStartDate() : Date
0..1
«interfa... Room
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Resource
- roomId: RoomId
- status: RoomStatus
«interface»
Event + available()
0..* + getRoomId() : RoomId
+ addResource(resource :Resource) 0..*
+ deleteResource(resource :Resource) : void 1 + occupied()
+ getDateRange() : DateRange
+ getDescription() : String GenericEvent
+ getParty() : Party
- description: String
ble
+
+
getResources() : List<Resource>
setDateRange(dateRange :DateRange) fe r a
+ setDescription(desc :String)
+ addResource(resource :Resource)
ans
+ setParty(party :Party)
+
+ getDateRange() : DateRange n r
deleteResource(resource :Resource) : void
- t
a
0..1
no 0..*
+ getDescription() : String
has eฺ
+ getParty() : Party
+ getResources() : List<Resource>
«interface» )
Party
ฺ c om uid +
+
setDateRange(dateRange :DateRange)
setDescription(desc :String)
+ getAddress() : Address
a c le nt G + setParty(party :Party)
+ getPhoneNumber(phone :PhoneNumber) r
o tude
+ setAddress(addr :Address) @
a is S
+ setPhoneNumber(phone :PhoneNumber) r m
e e th
v ฺ v
e s hฺ to us Reservation
( h it s e - quotedPrice: Money
a lice
GenericParty n - resNumber: ReservationNumber
e r m - status: ReservationStatus
V
- address: Address
-shphoneNumber: PhoneNumber + checkedIn()
e
Hit + getAddress() : Address + confirmed()
+ getQuotedPrice() : Money
+ getPhoneNumber() : PhoneNumber + getReservationNumber() : ReservationNumber
+ setAddress(addr :Address) + setQuotedPrice(price :Money) : void
+ setPhoneNumber(phone :PhoneNumber) + setReservationNumber(resNum :ReservationNumber)
Company Person
- companyName: String - firstName: String
- lastName: String
+ getFirstName() : String
+ getLastName() : String
+ setFirstName(firstName :String)
+ setlastName(lastName :String) : void
TimePeriod
ResourceUser
0..1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
1
used by
1..* 1
Event has ReourceAllocation
1 0..*
0..* e
1
r a bl
0..1 s fe
- t r an
Charges
n o n
a
) has eฺ
1 ฺ c om uid
r a cle ent G
@o Stud
0..*
ChargeableItem r a
m this 1
ฺ v e e
s h ฺv us Resource
it e t o
a ( h
e n se
e rm lic
h V
i t es describes
1..*
H
ChargeableItemType 1
ResourceType
Page 82 of 83
Abstract of a Private Hospital System using a Generic Framework
TimePeriod
HospitalStay
0..1
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
1
ResourceUser used by Event has ReourceAllocation
1 1..* 1 0..*
1 0..*
ble
fe r a
0..1
an s
Charges n - t r
Patient
a no 1
) has eฺ Resource
1 ฺ c om uid
r a cle ent G
@ o tud 1..*
a s S
erm e thi
0..* describes
HospitalBill
ฺ v
ฺv ChargeableItem
s h t o us 1
it e
a ( h
e n se ResourceType
erm li c HospitalResource
V
esh
Hit
ChargeableItemType
HospitalResourceType
Page 83 of 83
Unauthorized reproduction or distribution prohibitedฺ Copyright© 2020, Oracle and/or its affiliatesฺ
Hites
Vh
erm
a
i t e
lic
s h ฺ
(h ens e t
e
o
r a
vฺv use
r
m this
a
ฺ c
@o Stud
)
cle ent G
om uid
a
has eฺ
o n n
- t r an
sfe r a bl
e