Oose Lab - Manual (Final)
Oose Lab - Manual (Final)
C) Consider the class diagram of Exercise 1B. Note that the Part, Chapter, and
Section classes all include a title and a number attribute. Add an abstract class and
a generalization relationship to factor out these two attributes into the abstract
class.
Hint: Each physical library item - book, tape cassette, CD, DVD, etc. could have
its own item number. To support it, the items may be bar-coded. The purpose of
bar-coding is to provide a unique and scan able identifier that links the bar-coded
physical item to the electronic record in the catalog. Barcode must be physically
attached to the item, and barcode number is entered into the corresponding field in
the electronic item record. Barcodes on library items could be replaced by RFID
tags. The RFID tag can contain item's identifier, title, material type, etc. It is read
by an RFID reader, without the need to open a book cover or CD/DVD case to
scan it with barcode reader. Library has some rules on what could be borrowed
and what is for reference only. Rules are also defined on how many books could
be borrowed by patrons and how many could be reserved
1) Draw a use case diagram for a ticket distributor for a train system. The system
includes two actors: a traveler, who purchases different types of tickets, and a
central computer system, which maintains a reference database for the tariff.
Use cases should include: BuyOneWayTicket, BuyWeeklyCard,
BuyMonthlyCard, UpdateTariff. Also include the following exceptional
cases: Time-Out (i.e., traveler took too long to insert the right amount),
TransactionAborted (i.e., traveler selected the cancel button without
completing the transaction), DistributorOutOfChange, and
DistributorOutOfPaper
2) Draw a use case diagram to represent the following system. Over the summer
holiday, university students can book collegehall accommodation online. They
must specify their name, student number, course, year, and identify three college
residences as their preferences. The system makes an allocation of students to
rooms before the start of the term, trying, where possible, to allocate students to a
room in one of their preferred halls.
3) Draw a usecase diagram for on-line shopping Web Customer actor uses some
web site to make purchases online. Top level use cases are View Items, Make
Purchase and Client Register. View Items use case could be used by customer as
top level use case if customer only wants to find and see some products. This use
case could also be used as a part of Make Purchase use case. Client Register use
case allows customer to register on the web site, for example to get some coupons
or be invited to private sales. Note that Checkout use case is includedusecase not
available by itself - checkout is part of making purchase. Except for the Web
Customer actor there are several other actors .View Items use case is extended by
several optional use cases - customer may search for items, browse catalog, view
items recommended for him/her, add items to shopping cart or wish list. All these
use cases are extending use cases because they provide some optional functions
allowing customer to find item. Customer Authentication use case is included in
View Recommended Items and Add to Wish List because both require customer
1. Draw a sequence diagram representing the process of making a phone call from
a cell phone.
Hint: The objects involved include the caller, the phone network, the
receiver of the phone call, and the cell phone accounting department.
3. Draw a sequence diagram for a user to recharge his account online through third
party site.
1. Draw a UML state machine Diagram for a seminar during enrollment of student
in university.
Hint: Create a state machine when behavior differs based on state. A seminar
object is fairly complex, reacting to events such a enrolling a student differently
depending on its current state.
Hint: ATM is initially turned off. After the power is turned on, ATM performs
startup action and enters Self Test state. If the test fails, ATM goes into Out of
Service state, otherwise there is triggerless transition to the Idle state. In this state
ATM waits for customer interaction. The ATM state changes from Idle to Serving
Customer when the customer inserts banking or credit card in the ATM's card
reader. On entering the Serving Customer state, the entry action readCard is
performed. Note, that transition from Serving Customer state back to the Idle state
1. Draw an activity diagram for "Withdraw money from a bank account through an
ATM”.
2. Draw an activity diagram for 'Make lemon juice' and 'Make Ginger Juice'
activities are executed in parallel.
3. Draw an activity diagram for the activity to the respective objects like Customer,
Stock, Order processing, Payment and Invoice using swimlanes.
1. Draw a component diagram for a user to recharge his account online through
third party site.
Hint: Following components should be involved.
Third Party Home Page (visitor / registered user / admin / service
provider)
Third Party Register Page (visitor)
Third Party Login Page (registered user)
Third Party User History Page (registered user)
Request Recharge Page (registered user)
Third Party Logout Page (registered user)
Online Payment Transaction Gateway Page (direct user / registered user)
Service Provider Home Page (visitor / registered user / admin / service
provider)
Tariff Plans Page (visitor / registered user / admin / service provider)
Modules
1.Logon & Application Status
2.Submit an Enquiry for Information
3.Passport Renewal
4.passport approval
1 week for study and identify requirements of their projects this step is same for
all modules
Modules
1. Reservation
2. Cancelation
3. Enquiry
4. Accounting
1 week for study and identify requirements of their projects this step is same for
all modules
1A) Draw a class diagram representing a book defined by the following statement:
“A book is composed of a number of parts, which in turn are composed of a
number of chapters. Chapters are composed of sections.”Focus only on classes and
relationships. Add multiplicity to the class diagram.
C) Consider the class diagram of Exercise 2B. Note that the Part, Chapter, and
Section classes all include a title and a number attribute. Add an abstract class and
a generalization relationship to factor out these two attributes into the abstract
class.
Hint: Each physical library item - book, tape cassette, CD, DVD, etc. could have
its own item number. To support it, the items may be bar-coded. The purpose of
bar-coding is to provide a unique and scan able identifier that links the bar-coded
physical item to the electronic record in the catalog. Barcode must be physically
attached to the item, and barcode number is entered into the corresponding field in
the electronic item record. Barcodes on library items could be replaced by RFID
tags. The RFID tag can contain item's identifier, title, material type, etc. It is read
by an RFID reader, without the need to open a book cover or CD/DVD case to
scan it with barcode reader. Library has some rules on what could be borrowed
and what is for reference only. Rules are also defined on how many books could
be borrowed by patrons and how many could be reserved.
4) Draw a class diagram for online shopping. Each customer could have some
web user identity. Web user could be in several states and could be linked to one
shopping cart. Each customer has exactly one account. Account owns shopping
cart and orders. Orders are sorted and unique. Each order is linked to none to
several payments. Each order has current order status. Both order and shopping
cart have line items linked to specific product.
2) Draw a use case diagram to represent the following system. Over the summer
holiday, university students can book collegehall accommodation online. They
must specify their name, student number, course, year, and identify three college
residences as their preferences. The system makes an allocation of students to
rooms before the start of the term, trying, where possible, to allocate students to a
room in one of their preferred halls.
1.Draw a UML state machine Diagram for a seminar during enrollment of student
in university.
Hint: Create a state machine when behavior differs based on state. A seminar
object is fairly complex, reacting to events such a enrolling a student differently
depending on its current state.
Hint: ATM is initially turned off. After the power is turned on, ATM performs
startup action and enters Self Test state. If the test fails, ATM goes into Out of
Service state, otherwise there is triggerless transition to the Idle state. In this state
ATM waits for customer interaction. The ATM state changes from Idle to Serving
Customer when the customer inserts banking or credit card in the ATM's card
reader. On entering the Serving Customer state, the entry action readCard is
performed. Note, that transition from Serving Customer state back to the Idle state
could be triggered by cancel event as the customer could cancel transaction at any
time.
Hint: Water can exist in several states - liquid, vapor, solid, and plasma.
Several transitions are possible from one state to another. For example,
freezing is phase change from liquid state to ice. Condensation is phase
change from vapor state to liquid. Water vapor could turn directly into frost
through deposition.
IMPLEMENTATION
We are going to create a Student object acting as a model.StudentView will
be a view class which can print student details on console
and StudentControlleris the controller class responsible to store data
in Student object and update view StudentView accordingly.
Implementation
We're going to create a Shape interface and concrete classes implementing
the Shape interface. A factory class ShapeFactory is defined as a next step.
Implementation
We are going to create a Shape and Color interfaces and concrete classes
implementing these interfaces. We create an abstract factory
class AbstractFactory as next step. Factory
classes ShapeFactory and ColorFactoryare defined where each factory
extends AbstractFactory. A factory creator/generator class FactoryProducer is
created.
AbstractFactoryPatternDemo, our demo class uses FactoryProducer to get
a AbstractFactory object. It will pass information (CIRCLE / RECTANGLE /
SQUARE for Shape) to AbstractFactory to get the type of object it needs. It also
passes information (RED / GREEN / BLUE for Color) to AbstractFactory to get
the type of object it needs.
Implementation
We have a MediaPlayer interface and a concrete
class AudioPlayerimplementing the MediaPlayer interface. AudioPlayer can
play mp3 format audio files by default.
This pattern involves an interface which acts as a bridge which makes the
functionality of concrete classes independent from interface implementer
classes. Both types of classes can be altered structurally without affecting
each other.
Implementation
We have a DrawAPI interface which is acting as a bridge implementer and
concrete classes RedCircle, GreenCircle implementing
the DrawAPI interface. Shape is an abstract class and will use object
of DrawAPI. BridgePatternDemo, our demo class will use Shape class to
draw different colored circle.
Implementation
We are going to create a Shape interface and concrete classes
implementing the Shape interface. A facade class ShapeMaker is defined as
a next step.
This pattern creates a class that contains group of its own objects. This
class provides ways to modify its group of same objects.
Implementation
We have a class Employee which acts as composite pattern actor
class. CompositePatternDemo, our demo class will use Employee class to
add department level hierarchy and print all employees.
Implementation