Sei sulla pagina 1di 18

MIS326

OBJECT ORIENTED MODELING


WITH UML

ANALYSIS

Spring-910 1

MIS326 Analysis - Purpose


 An Analysis Model of
the system’s desired Inception Elaboration Construction Transition
behaviour:
– This model should be a
statement of what the
system does, not how it
does it
– We can think of the
analysis model as a
“first-cut” or “high level”
design model
– It is in the language of
the business

Spring-910 2
MIS326 Artifacts
 analysis class - handles functional requirements; one of
three basic stereotypes: boundary, control or entity

 analysis model - a conceptual model that refines the


requirements and structures them so that they are more
precise and maintainable

 analysis package - provides a means of organizing the


artifacts of the analysis model into manageable pieces

 use-case realization - describes how a specific use case


is realized and performed in terms of analysis classes and
their interacting analysis objects

Spring-910 3

Analyse a use case


MIS326
• identify analysis classes
• distribute use case behaviour to analysis classes
• specify interactions among analysis objects
Use-Case Model • capture special requirements (nonfunctional)

Analysis Class
Analyse a
Use Case

Supplementary
Requirements
Use Case
Realisation

Spring-910 4
MIS326 Analysis Class
 An abstraction of one or several classes in the final
system implementation
– focuses on handling functional requirements only

 class descriptions are conceptual, not implementation


oriented
– attributes: types are conceptual, not programming language types
– behavior: defined by textual descriptions of responsibilities
– relationships: conceptual, not implementation oriented

 classes are one of:

– boundary – entity – control

Spring-910 5

MIS326 Diff. Types of Analysis Classes

<<boundary>>

<<boundary>>

<<control>>
Use-case
behavior <<control>>
coordination
System
boundary

System
information <<entity>>

<<entity>>

Spring-910 6
Boundary Class
«boundary»
boundary
MIS326 boundary class name class name

 Models the interaction between the system and its


actors
– interacts with actors outside the system as well as with classes
within the system
– represents an abstraction of UI elements
• windows, forms, etc....
• devices (printer interfaces, sensors, terminals, etc....)
– description should be kept on a fairly high conceptual level
• do not describe every button, menu item, etc. of a UI
– encapsulates and isolates changes in the system’s interface

Spring-910 7

The Role of a Boundary Class


MIS326

Customer

Spring-910 8
MIS326 Identifying Boundary Classes
 found from use case descriptions → start from actors
– Collect information from the actor
• identify forms and windows needed to enter data into the system
– Present information to the actor
• identify notices and messages the systems uses to respond
– do not model the visual aspects of the interface

 identify one central boundary class for each human actor


– represents the primary UI window with which the actor interacts

 identify one central boundary class for each external system actor
– represents the communication interface to the external system

Spring-910 9

MIS326
Example:Boundary Classes: Professor Actor
Professor Select courses to teach

SelectCoursesUI

Professor

RequestEnrollmentUI

SelectCoursesUI

Professor ProfessorUI

RequestEnrollmentUI

Spring-910 10
MIS326 Example:Boundary Classes: Professor Actor

CreateScheduleUI

ReviewScheduleUI

SelectCoursesUI

ProfessorUI ModifyScheduleUI

RequestEnrollmentUI

Spring-910 11

Entity Class
«entity»
entity
MIS326 entity class name class name

 Models information that is long-lived and often


persistent
– represents concepts such as an individual, a real-life object or
a real-life event
– will likely be implemented as part of a database
– encapsulates and isolates changes to the information it
represents

Spring-910 12
MIS326 What is an Entity Class?
 Key concepts of the system

<<entity>>
Glossary

Spring-910 13

MIS326 The Role of an Entity Class

Spring-910 14
Example:
MIS326
Entity Classes: Select Courses To Teach

Professor Select courses to teach

Course

Professor SelectCoursesUI CourseOffering

ProfessorInfo

Spring-910 15

«control»

MIS326 Control Class control class name


control
class name

 Models coordination, sequencing, transaction and


control behaviour for one or more use cases
 “glue” that ties other classes together into one use-case realization
 initially, we assign one control class for each actor/use case pair
– responsible for the flow of events in the use case

– complicated behavior may need to be divided among several control classes later on

– may also combine/eliminate some control classes later on

– a control class should only be tied to at most one actor


– encapsulates and isolates changes to control logic

Spring-910 16
MIS326 What is a Control Class?
 Use case behavior coordinator

<<control>>

Use Case

Spring-910 17

MIS326
Example:
Control Class: Select Courses To Teach

Professor Select courses to teach

Course

Professor SelectCoursesUI SelectCoursesMgr ? CourseOffering

ProfessorInfo

Spring-910 18
MIS326
Interaction — Best Practices
 Actors can interact only with boundary classes
 Boundary classes can interact only with control
classes and actors

boundary class boundary class

 Entity classes can interact only with control classes

entity class entity class

 Control classes can interact with boundary, entity and


other control classes

Spring-910 19

MIS326 The Role of a Control Class

Spring-910 20
MIS326 Use Case Partitioning Example

Use-Case Model
Select courses to teach

«trace»

Analysis Model
Select courses to teach

SelectCoursesUI SelectCoursesMgr Course CourseOffering Section ProfessorInfo

Spring-910 21

MIS326
Summary:A First Step Towards Executables

Use Cases Analysis Design Source Exec


Classes Classes Code

Spring-910 22
MIS326
Summary: Find Classes From Use-Case Behavior

 The complete behavior of a Use-Case has to be


distributed to analysis classes.

<<boundary>>

<<control>> <<boundary>>

<<entity>>
<<entity>>

Spring-910 23

MIS326 Summary: Analysis Classes

Student Register for Courses Course Catalog System

Use Case Model

Analysis Model

MainForm MaintainScheduleForm RegistrationController

Schedule CourseCatalogSystem

Spring-910 24
MIS326
Entity Classes
 Entity classes represent stores of information in the
system
 Used to represent the key concepts the system
manages.
 Entity objects (instances of entity classes) are used to
hold and update information about some
phenomenon, such as an event, a person, or some
real-life object.
 They are usually persistent

 The main responsibilities of entity classes are to


store and manage information in the system.

Spring-910 25

MIS326 Noun/verb Analysis Procedure


 Collect all of the relevant documentation
– Requirements specification document
– Use cases specifications
– Glossary
– Anything else!

 Extract the nouns and noun phrases


 Make a list of nouns and noun phrases
– These are candidate classes or attributes

 Make a list of verbs and verb phrases


– These are candidate responsibilities

Spring-910 26
MIS326 Example-1: Case Study: Video Rental
This problem is about a small, local video rental store (VRS). The problem will be limited
to rental, return, management of inventory (add/delete new tapes, change rental prices,
etc.) and producing reports summarizing various business activities. The rental items of
the store are limited to video tapes. Customer ID number (arbitrary number), phone
number or the combination of first name and last name are entered to identify customer
data and create an order. The bar code ID for each item is entered and video
information from inventory is displayed. The video inventory file is decreased by one
when an item is checked out. When all tape IDs are entered, the system computes the
total rental fee, and payments are processed. A return is processed by reading the bar
code of returned tapes. Any outstanding video rentals are displayed with the amount
due on each tape and a total amount due. The past-due amount must be reduced to
zero when new tapes are taken out. For new customers , the unique customer ID is
generated and the customer information is entered into the system. Videos are stacked
by their category such as Drama, Comedy, Action, etc. Any conflict between a customer
and computer data is resolved by the store manager. Rental fees can be paid by either
cash, check or a major credit card. Reporting requirements include viewing customer
rental history, video rental history, and titles by category, top ten rentals, and items by
status, and overdue videos by customers and outstanding balances by customers .

Spring-910 27

MIS326 Example-1: Nouns


 Video Rental Store :  Bar Code ID

 VRS :  Video Inventory File:

 Rental :  Tape ID, Total Rental Fee

 Return:  Amount due :

 Business Activities:  Total Amount due:

 Problem:  Past-due Amount

 Management , System :  Zero

 Inventory :  Customer

 (Video)Tapes :  Customer Information :

 Rental Prices :  Computer Data

 Reports :  Category

 Rental Items:  Drama, Comedy, Action

 Store:  Conflict

 Customer ID :  Store Manager

 Arbitrary Number:  Rental fee

 Customer Data :  Cash, Check, Credit Card

 Video Information  Reporting Requirements

 Phone Number :  Video / Customer Rental History

 Combination :  Titles

 First Name, Last Name :  Top Ten Rentals

 Payments :  Item Status :

 Order :  Outstanding Balances:


 Overdue Videos :
Spring-910 28
MIS326 Finding Entity Classes - Elimination
 Remove redundant candidate classes.
– Two nouns represent the same abstraction. keep the more descriptive noun. For
example, use customer, instead of user in ATM domain.
 Remove vague candidate classes
– The nouns have ill-defined or too broad scope: business activities
 Remove implementation constructs
– The nouns represent an implementation-related class such as set, string, or algorithm.
 Remove meta-language constructs.
– The noun is used to describe and explain requirements and the system at a very high
level. systems, information, or reporting requirements.
 Remove operations (save for later)
– The nouns represent operations, computation, ROI (Return-on-Investment)

Spring-910 29

MIS326 Finding Entity Classes - Elimination


 Remove attributes (save for later)
– The nouns represent a text or a number, name, age, phone number
 There are often delicate cases where it seems uncertain
whether a noun should be modeled as an attribute or a
class, use the following rules:
– Rule of One-Property :
• IF a noun has only one property to remember THEN it is an attribute of another class ELSE it is a
class.

– Rule of Dependence :
• IF the identification of an object (noun) relies on another concept object (noun) THEN it is an
attribute.

– Rule of Independence :
• IF the noun represents an object which is important in its own right THEN it is a class.

 Remove Values.
– The nouns represent a value itself.

Spring-910 30
MIS326 Finding Entity Classes- Categorize
 Roles of People : humans who carry out some important function. Student, Employee, Customer.
 Places : locations where important business activities are held. Office, Warehouse, Store.
 Physical Things : tangible objects. Machine, Product, Device, and Book.
 Organizations : important business units. Company, Team, and Department.
 Events (Transactions) : important activities that need to record some data Order, Promotion,
Payment.
 Transaction Line Items : an element of a transaction. Order-Line-Item, Purchase-Line-Item.
 Concepts (Discovered Class; Intangible Things) : intangible ideas used to keep track of
business activities. Project, Account, Complaint
 Specification: a description of other items that need to be distinguished from one another.
Video-Title, Flight-Plan.
 Interaction : an association between two classes with meaningful attributes. Reservation.
 Rules/Policies : important business rules. Rental-Policy and Shipping Method.
 Containers of other things : classes that will contain other classes. Store, Shelf, Catalog, Bin.
 Things in a container : classes that will be contained in another class. Item, Passenger, and
Video-Title in a catalog.
 Financial Instruments and Services. They represent class that are used to support financial
activities. Stock, Bond, and Mortgage.

Spring-910 31

MIS326 Example-1: Elimination


 Tape ID, Total Rental Fee : Attribute
 Video Rental Store: Redundant
 Amount due,Total Amount due, Past-due Amount : Attribute
 VRS : Place √
 Zero : Value
 Rental : Transaction √
 Customer : Roles of People √
 Return: Reverse of Rental
 Customer Information, Computer Data :Vague
 Business Activities, Problem , Management , System : Meta  Category: Attribute
language
 Drama, Comedy, Action : Value
 Inventory : Catalog √
 Conflict : Irrelevant
 (Video)Tapes : Physical Thing √
 Store Manager : Roles of People √
 Rental Prices : Attribute
 Rental fee: Attribute
 Reports : Derived
 Cash, Check, Credit Card : Physical Thing √
 Rental Items: Transaction Line Item √  Reporting Requirements : Meta language
 Store: The same as VRS, Redundant  Video / Customer Rental History : Derived
 Customer ID : Number Attribute  Titles : Specification √
 Arbitrary Number , Customer Data , Video Information : Vague  Top Ten Rentals : Derived
 Phone Number : Attribute  Item Status, Outstanding Balances: : Attribute
 Combination : Irrelevant  Overdue Videos :Roles
 First Name, Last Name : Attribute
 Payments : Transaction √  Cat 1 : People: Staff
 Order : The same as Rental; Redundant  Cat 2 : Location: Shelf
 Bar Code ID : Attribute
 Cat 10 : Rules/Policies: Loan Policy
 Video Inventory File: Same as Inventory; Redundant

Spring-910 32
MIS326 Example-1:Class Diagram

Customer Rental RentalItem VideoTape VRS

Payment Inventory LoanPolicy Title Shelf

Cash Chec k CC Staff Employee Manager

Spring-910 33

MIS326 Example-2: Car Rental Use Case


1. This use case begins when a customer indicates he wishes to make a reservation for a rental car.
2. The system prompts the customer for the pickup and return locations of the reservation, as well as the
pickup and return dates and times.
3. The customer indicates the desired locations and dates.
4. The system prompts for the type of vehicle the customer desires.
5. The customer indicates the vehicle type.
6. The system presents all matching vehicles available at the pickup location for the selected date and
time.
7. If the customer requests detail information on a particular vehicle, the system presents this information
to the customer.
8. If the customer selects a vehicle for rental, the system prompts for information identifying the customer
(full name, telephone number, email address for confirmation, etc.).
9. The customer provides the required information.
10. The system presents information on protection products (such as damage waiver, personal accident
insurance) and asks the customer to accept or decline each product.
11. The customer indicates his choices.
12. If the customer indicates "accept reservation," the system informs the customer that the reservation has
been completed, and presents the customer a reservation confirmation.
13. This use case ends when the reservation confirmation has been presented to the customer.

Spring-910 34
MIS326 Example-2: Car Rental
 Customer : Roles of People √
 Reservation : Transaction √
 Rental car : Redundant
 Locations of the reservation : Place √
 Pickup date, return dates/times : Attribute
 Locations : Redundant
 Dates : Attribute
 Type of vehicle , vehicle type : Attribute
 Vehicles : Physical Thing √
 Pickup location : Redundant
 Detail information : Vague
 Full name, telephone number, email address : Attribute
 Confirmation : Value
 Protection products : Concept √
 Damage waiver: Value
 Personal accident insurance : Value
 Product: Redundant
 Reservation confirmation : Derived

Spring-910 35

MIS326 Example-2: Car Rental

Customer Res ervation

Rental Location ProtectionProduct Vehicle

Spring-910 36

Potrebbero piacerti anche