Sei sulla pagina 1di 7

MIS326

OBJECT ORIENTED MODELING


WITH UML

ANALYSIS
Classes - Relationships

Spring 910 1

MIS326
Finding / Identifying Attributes
 Look for information that must be maintained about each
class
– Examine each class in turn
– Examine the Use Case Scripts
– What information is the class responsible for?
– What information does the class use?
• Nouns rejected as classes may become attributes
• Choose descriptive names
 An attribute should generally contain a simple value
 If noun is simply a number or text in real life, it should be
an attribute.

Spring 910 2
Tips about identifying and specifying valid
MIS326
attributes
• It is not good to have many duplicate attributes
• If a subset of a class’s attributes form a coherent group,
then create a distinct class containing these attributes

Person Person Person Address


* addresses
name name name * street
addresses street1 municipality
municipality1 provOrState
provOrState1 country
Bad due to country1 postalcode
a plural postalCode1 type
attribute street2
municipality2 Good solution. The
provOrState2 type indicates whether
country2
postalCode2
it is a home address,
business address etc.
Bad due to too many
attributes, and inability
to add more addresses
Spring 910 3

MIS326 Finding/Identifying Operations


 Verbs that imply an action rather than just a relationship
– Customers who log onto the ... site
• login

– The customer may fill their "shopping cart“


• addNewItem
• removeAnItem

Spring 910 4
MIS326 Categories of Operation
• Setting and getting the values of attributes
• Creating and initializing new instances
• Loading to and saving from persistent storage
• Destroying instances
• Adding and deleting links of associations
• Copying, converting, transforming, transmitting or
outputting
• Computing numerical results
• Navigating and searching
• Other specialized work

Spring 910 5

MIS326 Tip for Allocating Operations to Classes


 A driving influence on where a operation should
go is the location of the data needed to perform
the operation.
 Who has the data needed to perform the
operation?
– One class has the data, put the operation with the data –
best case!!!
– Multiple classes have the data:
• Put the operation in the control class, and add
relationships to classes needed
 When a new operation is identified, check to
see if there is an existing class that has similar
operation, reuse classes where possible.
Spring 910 6
MIS326

Spring 910 7

MIS326 Finding Associations


 Find verbs and nouns identifying actions or processes
in the problem description.
– Identify the concerned classes for each association.

Spring 910 8
MIS326 Categories

Spring 910 9

MIS326 Identifying Associations and Attributes


• Start with classes you think are most central and
important
• Decide on the clear and obvious data it must contain
and its relationships to other classes.
• Work outwards towards the classes that are less
important.

Spring 910 10
MIS326 Actions versus associations

• A common mistake is to represent actions as if


they were associations

LibraryPatron

* *
*
LibraryPatron
borrow return Loan *

borrowedDate
* * dueDate *
returnedDate CollectionItem
CollectionItem
Better: The borrow operation creates a Loan , and
Bad, due to the use of associations the return operation sets the returnedDate
that are actions attribute.

Spring 910 11

Exam (1+ple)
MIS326
 A graphical model that shows the system in relation to the actors in its environment is a ________________.
 The sequence of actions of an actor and the corresponding responses of the system is known as a(n) ______.
 ______________ stereotype indicates that one use case provides a variation of the behaviors and actions to the use case
it is connected to
 To send a message between objects, there has to be a(n) ________________between the objects .
 Additional information written between << ...>> is called a(n) ____________________
 Message-passing as a time-ordered sequence is represented directly in ___________________________
 _____________ is the actual data values stored in an object at any point in time
 ____________________ relationships exist between superclasses and subclasses
 _____________________interact with the use case after it has been triggered
 An ____________ class is one that represents initial data and behavior, without specifying the software- and hardware-
oriented details.
 ________________is OOAD methodology that unified their three separate methodologies
 ____________ classes are those whose primary focus is to hold persistent data.
 A ______ is used in UML to associate two objects by employing a qualifier to select one instance or a subset of
instances at the server end.
 ____________ classes are those that provide interaction to the system for actors.
 The relationship between a DVD and its ________________ is a composition.
 A single message “drawYourself()” is sent to two types of window objects. One type of object responds by painting a
bar chart. The other responds by displaying a photographic image. __________________ best describes this scenario?
 A(n) ____________ is an abstraction of a system, usually depicted via diagrams.
 ______________ use cases have no direct interactions with actors.
 If an object’s attributes are ______, it means that they are only accessible from within the object.
Spring 910 12
Exam (1+ple)
MIS326
As a junior MIS student you have been hired for a training in a (agency) branch (i.e. kadıköy branch
office) of major insurance company (i.e. Istanbul Sigorta) (main company system is refered to as ISS).
By chance you are asked to develop a small system for the branch using UML. This new stystem will
be used by any clerk in the branch office.
 The clerk will enter customer information.
 The system will search the best policy for the customer.
 The clerk will recommend the policy that best meet the member needs.
 The customer sometimes buys a policy but sometimes they won’t.
 The system will notify the ISS of all sales.
 ISS will notify any premium change or add a new policy.
 The clerk can renew a policy and notify ISS for all renewals.
 The system will generate on a weekly basis renewal notices.
 The system will calculate insurance premium for recommendations, sales and renewal notices.

Draw a UML use case diagram of the agency system. (The system has no login)

Spring 910 13

Exam (1+ple)
MIS326

Draw a UML data class diagram for a product part distributor’s inventory system.
The system keeps track of parts stored in its warehouses. Information about parts
include their part number and a description. Parts can be manufactured parts or
purchased parts. Manufactured parts have additional data, specifically a routing
number. Purchased parts are received from suppliers. The distributor has many
suppliers, each of which can supply any number of purchased parts. In addition,
each purchased part may be supplied by one or more suppliers. Each supplier has
a different price quote for each purchased part. The price quote includes both the
unit price and the bulk-rate price. In addition, the inventory system also includes a
library of storage instructions. Storage instructions are identified by an instruction
ID, and include a location and container type. Each part must be associated with at
least one storage instruction, and a storage instruction may be associated with any
number of parts. Parts may contain or be contained in any number of other parts
(as subparts).

Spring 910 14

Potrebbero piacerti anche