You are on page 1of 63

Advance Class Modeling

Why the previous model is


discouraged ?
• Each msg has an owner mailbox, date recorded, time
recorded, priority, msg contents and a flag indicating if
it has been received.
• A msg may have a mailbox as the source or it may be
from an external call.
• Each mailbox has a phone no., password and recorded
greeting.
• For the PhoneMsg class we can store the max duration
for a msg and the max days a msg will be retained.
• ||ly, for the PhoneMailbox class, we can store the max
no. of msgs that can be stored.
Why the previous model is
discouraged ?
• The previous model is discouraged, because
the max duration, max days retained and max
msg count have a single value for the entire
phone mail system.

• Therefore, the next model, we show that


these limits can vary for different kinds of
users, yielding a more flexible and extensible
phone mail system.
• Package (default) :
Indicates that the attribute is public, but only to
classes in the same pachage.
Shown by ~ sign.
Remember
• Promoting the use of n-ary associations to
classes, the meaning the model changes.
• So take care when using n-ary associations.
Concrete Class vs Abstract Class
• An abstract class is a class that has no direct
instances BUT whose descendent classes have
direct instances.
• A concrete class is a class that is instantiable,
i.e., it can have direct instances .
• A Concrete class may have abstract subclasses
(but they in turn must have concrete
descendents).
Concrete Class vs Abstract Class
• An abstract class is meant to be used as the
base class from which other classes are
derived.
• The derived class is expected to provide
implementations for the methods that are not
implemented in the base class.
• A derived class that implements all the
missing functionality is called a concrete class.
• Prepare an Object diagram for an imaginary
round tripe you took last weekend to
London. Include at least one instance of each
class. Fortunately, direct flights on a hyper
sonic plane were available. A friend went
with you but decided to stay a while and is
still there. Captain Johnson was your pilot on
both flights. You had a different seat each
way, but noticed it was on the same plane
because of a distinctive dent in the
• tail section. Students should indicate
unknown values with a “?”.
• Class Diagram for Library Management System
Class Diagram for ATM Machine
Class Diagram for Online Restaurant
System
Class Diagram for Online Reservation
System
Class Diagram for Online Shopping
System
• Prepare a class diagram for each group of
classes. Add at least 10 relationships
(associations and generalizations) to each.
• File system, file, ASCII file, binary file, directory
file, disc, drive, track and sector.
• Prepare a class diagram for group of classes.
Sink, freezer, refrigerator, table, light, switch,
window, smoke alarm, burglar alarm, cabinet,
bread, cheese, ice, door, kitchen.

You might also like