Ooase UNIT 3
Ooase UNIT 3
Business Object Analysis - Use Case Driven Object Oriented Analysis - Business
Process Modeling - Use Case model - Developing Effective Documentation - Object
Analysis Classification: Classification Theory - Noun Phrase Approach - Common
Class Patterns Approach - Use-Case Driven Approach - Classes Responsibilities and
Collaborators - Naming Classes - Identifying Object Relationships, Attributes and
Methods: Association - SuperSubclass Relationships - A-part of Relationships.
Analysis
Analysis is the process of extracting the needs of a system and what the system must do to satisfy
the users' requirement.
The goal of object oriented analysis is to understand the domain of tile problem and the system's
responsibilities by understanding how the users use or will use the system.
The first step in finding an appropriate solution to a given problem is to understand the problem and
its domain.
The main objective of the analysis is to capture a complete, unambiguous, and consistent picture of
the requirements of the system and what the system must do to satisfy the users' requirements and
needs.
This is accomplished by constructing several models of the system that concentrate on describing
what the system does rather than how it does it.
Separating the behavior of a system from the way that behavior is implemented requires
viewing the system from the perspective of the user rather than that of the machine.
Analysis is the process of transforming a problem definition from a fuzzy set of facts and
myths into a coherent statement of a system's requirements.
Analysis is a creative activity that involves understanding the problem, its associated
constraints, and methods of overcoming those constraints.
This is an iterative process that goes on until the problem is well understood .Norman
explains the three most common sources of requirement difficulties:
1. Fuzzy descriptions - such as "fast response time" or "very easy and very secure updating
mechanisms." A requirement such as fast response time is open to interpretation, which might
lead to user dissatisfaction if the user's interpretation of a fast response is different from the
systems analyst's interpretation
These reasons could include the users' forgetting to identify them, high cost, politics within
the business, or oversight by the system developer.
However, because of the iterative nature of objectoriented analysis and the unified approach
most of the incomplete requirements can be identified in subsequent tries.
3. Unnecessary features - When addressing features of the system, keep in mind
that every additional feature could affect the performance, complexity, stability,
maintenance, and support costs of an application.
Experience often is the best teacher. If the first try reflects the errors of an
incomplete understanding of the problems, refine the application and try another
run.
BUSINESS OBJECT ANALYSIS:
The outcome of the business object analysis is to identify classes that make up the
business layer and the relationships that play a role in achieving system goals.
Usecase Driven Object Oriented Analysis: The Unified Approach
The object-oriented analysis (OOA) phase of the unified approach uses actors and
use cases to describe the system from the users' perspective.
The actors are external factors that interact with the system ;use cases are scenarios
that describe how actors use the system.
The use cases identified here will be involved throughout the development process.
Business process modeling can be very time consuming, so the main idea
should be to get a basic model without spending too much time on the process.
The advantage of developing a business process model is that it makes you more
familiar with the system and therefore the user requirements and also aids in
developing use cases.
For example, let us define the steps or activities involved in using your school
library.
A use-case model can be instrumental in project development, planning, and documentation of systems
requirements.
A use case is an interaction between users and a system; it captures the goal of the users and the
responsibility of the system to its users). For example, take a car; typical uses of a car include "take you
different places" or "haul your stuff" or a user may want to use it "off the road.“
The use-case model describes the uses of the system and shows the courses of events that can be
performed.
A use-case model also can discover classes and the relationships among subsystems of the systems.
Use-case model can be developed by talking to typical users and discussing
the various things they might want to do with the application being
prepared.
Each use case must have a name and short textual description,no more
than a few paragraphs.
The object model represents an internal view of the system, as opposed to the
usecase model, which represents the external view of the system.
The object model shows how the business is run. Jacobson, Ericsson, and Jacobson
call the use-case model a "what model," in contrast to the object model, which is a
"how model.".
Guidelines for developing Use Case Models:
Use Cases under the Microscope
Uses and Extends Associations
Identifying the Actors
Guidelines for Finding Use Cases
How Detailed Must a Use Case Be? When to Stop Decomposing and
When to Continue
Dividing Use Cases into Packages
Naming a Use Case
Use Cases under the Microscope: Use cases represent the things that the user is
doing with the system, which can be different from the users' goals.
"A Use Case is a sequence of transactions in a system whose task is to yield results
of measurable value to an individual actor of the system."
Use case - Use case is a special flow of events through the system. By definition,
many courses of events are possible and many of these are very similar.
Actors - An actor is a user playing a role with respect to the system. When dealing
with actors, it is important to think about roles rather than just people and their job
titles.
A measurable value- A use case must help the actor to perform a task that has some
identifiable value.
2.Use-case name: Get an interlibrary loan. A member requests a book that the
library does not have. The book is located at another library and ordered
through an interlibrary loan.
3.Use-case name: Return books. A member brings borrowed books back to the
library.
4.Use-case name: Check library card. A member submits his or her library card to
theclerk, who checks the borrower's record.
5. Use-case name: Do research. A member comes to the library to do research. The
member can search in a variety of ways (such as through books, journals, CDROM,
WWW) to find information on the subjects of that research.
6. Use-case name: Read books, newspaper. A member comes to the library for a
quiet place to study or read a newspaper, journal, or book.
7.. Use-case name: Purchase supplies. The supplier provides the books, journals,
and newspapers purchased by the library.
Uses and Extends Associations: A use-case description can be difficult to understand if it
contains too many alternatives or exceptional flows of events that are performed only if
certain conditions are met as the use-case instance is carried out.
A way to simplify the description is to take advantage of extends and uses associations.
The extends association is used when you have one use case that is similar to another use case
but does a bit more or is more specialized; in essence, it is like a subclass.
The uses association occurs when you are describing your use cases and notice that some of
them have subflows in common.
To avoid describing a subflow more than once in several use cases, you can extract the
common subflow and make it a use case of its own.
This new use case then can be used by other use cases. The relationships among the other use
cases and this new extracted use case are called a uses association
A user may play more than one role. For instance, a member of a public library also may play
the role of volunteer at the help desk in the library.
However, an actor should represent a single user; in the library example, the member can
perform tasks some of which can be done by others and others that are unique.
However, try to isolate the roles that the users can play.(Fig)
You have to identify the actors and understand how they will use and interact with the system
Another issue worth mentioning is that actors need not be human, although actors
are represented as stick figures within a use case diagram.
An actor also can be an external system. For example, an accounting system that
needs information from a system to update its accounts is an actor in that system .
Guidelines for Finding Use Cases: When you have defined a set of actors, it is time to
describe the way they interact with the system.
This should be carried out sequentially, but an iterated approach may be necessary. Here
are the steps for finding use cases :
1. For each actor, find the tasks and functions that the actor should be able to perform or
that the system needs the actor to perform.
The use case should represent a course of events that leads to a clear goal (or, in some
cases, several distinct goals that could be alternatives for the actor or for the system).
3. Describe the use cases briefly by applying terms with which the user is familiar. This
makes the description less ambiguous.
Once you have identified the use-cases candidates, it may not be apparent that all of these use cases
need to be described separately; some may be modeled as variants of others. Consider what the
actors want to do.
It is important to separate actors from users. The actors each represent a role that one or several
users can play.
Therefore, it is not necessary to model different actors that can perform the same use case in the
same way.
The approach should allow different users to be different actors and play one role when performing
a particular actor's use case.
Thus, each use case has only one main actor. To achieve this, you have to
A use case, as already explained, describes the courses of events that will be carried out
by the system.
Jacobson et al. believe that, in most cases, too much detail may not be very useful.
During analysis of a business system, you can develop one use-case diagram as the
system use case and draw packages on this use case to represent the various business
domains of the system.
For each package, you may create a child usecase diagram. On each child use-case
diagram, you can draw all of the use cases of the domain, with actions and interactions.
You can further refine the way the use cases are categorized.
The extends and uses relationships can be used to eliminate redundant modeling of
scenarios.
When should use cases be employed? Use cases are an essential tool in capturing
requirements and planning and controlling any software development project.
Capturing use cases is a primary task of the analysis phase. Although most use
cases are captured at the beginning of the project, you will uncover more as you
proceed.
The UML specification recommends that at least one scenario be prepared for each
significantly different kind of use case instance.
Dividing Use Cases into Packages Each use case represents a particular scenario in
the system.
You may model either how the system currently works or how you want it to work.
A design is broken down into packages. You must narrow the focus of the scenarios
in your system.
In this case, there should be three separate packages, one each for Borrow books,
Do research, and Purchase books.
Many applications may be associated with the library system and one or more
databases used to store the information (see Figure).
7. Naming a Use Case Use-case names should provide a general description of the
use-case function.
The name should express what happens when an instance of the use case is
performed." Jacobson et al. recommend that the name should be active, often
expressed in the form of a verb (Borrow) or verb and noun (Borrow books).
The naming should be done with care; the description of the use case should be
descriptive and consistent.
For example, the use case that describes what happens when a person deposits
money into an ATM machine could be named either receive money or deposit
money.
A library system can be divided into many packages, each of which encompasses
multiple use cases
Developing Effective Documentation
Documenting your project helps reveal issues and gaps in the analysis and design.
A document can serve as a communication vehicle among the project's team members, or it
can serve as an initial understanding of the requirements.
Blum concludes that management has responsibility for resources such as software, hardware,
and operational expenses.
The main issue in documentation during the analysis phase is to determine what the system
must do.
Decisions about how the system works are delayed to the design phase.
How .will a document be used? (If it will not be used, it is not necessary.)
The documentation depends on the organization's rules and regulations. Most organizations
have established standards or conventions for developing documentation.
However, in many organizations, the standards border on the nonexistent. In other cases, the
standards may be excessive.
Too little documentation invites disaster; too much documentation, as Blum put it, transfers
energy from the problem solving tasks to a mechanical and unrewarding activity.
Each organization determines what is best for it, and you must respond to that definition and
refinement.
2. Guidelines for Developing Effective Documentation
Bell and Evans provide us the following guidelines for making documents fit the
needs and expectations of your audience:
1.Common cover. All documents should share a common cover sheet that
identifies the document, the current version, and the individual responsible for the
content. As the document proceeds through the life cycle phases, the responsible
individual may change. That change must be reflected in the cover sheet .
2.80-20 rule. As for many applications, the 80-20 rule generally applies for
documentation : 80 percent of the work can be done with 20 percent of the
documentation. The trick is to make sure that the 20 percent is easily accessible and
the rest (80 percent) is available to those (few) who need to know.
3.Familiar vocabulary. The formality of a document will depend on how it is used and who
will read it. When developing a documentation use a vocabulary that your readers understand
and are comfortable with. The main objective here is to communicate with readers and not
impress them with buzz words.
4.Make the document as short as possible. Assume that you are developing a manual. The key
in developing an effective manual is to eliminate all repetition; present summaries, reviews,
organization chapters in less than three s; and make chapter headings task oriented so that the
table of contents also could serve as an index .
5.Organize the document. Use the rules of good organization (such as the organization's
standards, college handbooks, Stunk and White's Elements of Style or the University of
Chicago Manual of Style) within each section. Appendix A provides a template for
developing documentation for a project. Most CASE tools provide documentation capability
by providing customizable reports. The purpose of these guidelines is to assist you in creating
an effective documentation
Object Analysis : Classification:
. Booch explains that, intelligent classification is part of all good science. Classification
guides us in making decisions about modularization
We may choose to place certain classes and objects together in the same module or in
different modules, depending upon the sameness we find among these declarations; coupling
and cohesion are simply measures of this sameness.
We place certain processes together in the same processor or different processors, depending
upon packaging, performance, or reliability concerns.
Human beings classify information every instant of their waking lives. We
recognize the objects around us, and we move and act in relation to them.
For example, when you see a new model of a car, you have no trouble
identifying it as a car.
What has occurred here, even though you may never have seen this particular
car before, is that you not only can immediately identify it as a car, but you
also can guess the manufacturer and model.
Clearly, you have some general idea of what cars look like, sound like, do, and
are good for-you have a notion of car-kind or, in object-oriented terms, the
class car.
Classes are an important mechanism for classifying objects. The chief role of a class is to
define the attributes, methods, and applicability of its instances.
The class car, for example, defines the property color. Each individual car (formally, each
instance of the class car) will have a value for this property, such as maroon, yellow, or white.
It is natural to partition the world into objects that have properties (attributes)and methods
(behaviors).
It is common and useful partitioning or classification, but we also routinely divide the world
along a second dimension: We distinguish classes from instances.
However, you always can combine these approaches to identify classes for a given
problem. Another approach that can be used for identifying classes is Classes,
Responsibilities, and Collaborators (CRC) developed by Cunningham, Wilkerson,
and Beck. Classes, responsibilities, and Collaborators, more technique than
method, is used for identifying classes responsibilities and therefore their attributes
and methods.
Noun Phrase Approach:
The noun phrase approach was proposed by Rebecca Wirfs-Brock, Brian Wilkerson, and
Lauren Wiener .
In this method, you read through the requirements or use cases looking for noun phrases.
Nouns in the textual description are considered to be classes and verbs.
To be methods of the classes All plurals are changed to singular, the nouns are listed, and the
list divided into three categories relevant classes, fuzzy classes and irrelevant classes.
It is safe to scrap the irrelevant classes, which either have no purpose or will
be unnecessary. Candidate classes then are selected from the other two
categories.
Keep in mind that identifying classes and developing a UML class diagram just like
other activities is an iterative process.
Depending on whether such object modeling is for the analysis or design phase of
development, some classes may need to be added or removed from the model and,
remember, flexibility is a virtue.
You must be able to formulate a statement of purpose for each candidate class; if not,
simply eliminate it.
i) Identifying Tentative Classes
All classes must make sense in the application domain; avoid computer
implementation classes-defer them to the design stage.
The following guidelines help in selecting candidate classes from the relevant and
fuzzy categories of classes in the problem domain.
Redundant classes. Do not keep two classes that express the same information.
if more than one word is being used to describe the same idea, select the one that is
the most meaningful in the context of the system.
Choose your vocabulary carefully; use the word that is being used by the user of
the system.
Adjectives classes.
An adjective can suggest a different kind of object, different use of the same
object, or it could be utterly irrelevant.
Does the object represented by the noun behave differently when the adjective is
applied to it? If the use of the adjective signals that the behavior of the object is
different, then make a new class" .
For example, Adult Members behave differently than Youth Members, so ,the two
should be classified as different classes
Attribute classes. Tentative objects that are used only as values should be defined or
restated as attributes and not as a class.
For example, Client Status and Demographic of Client are not classes but attributes
of the Client class.
Irrelevant classes. Each class must have a purpose and every class should be clearly
defined and necessary. You must formulate a statement of purpose for each
candidate class. If you cannot come up with a statement of purpose, simply
eliminate the candidate class
The process of eliminating the redundant classes and refining the remaining classes is
not sequential. You can move back and forth among these steps as often as you like.
Reviewing the Classes Containing Adjectives
We again review the remaining list, now with an eye on classes with adjectives. The main
question is this:
Does the object represented by the noun behave differently when the adjective is applied to
it?
If an adjective suggests a different kind of class or the class represented by the noun behaves
differently when the adjective is applied to it, then we need to make a new class.
However(it is a different use of the same object or the class is irrelevant, we must eliminate
it) In this example, we have no classes containing adjectives that we can eliminate.
Reviewing the Possible Attributes :
The next review focuses on identifying the noun phrases that are attributes, not classes.
This process also will help us identify the attributes of the classes in the system.
Identifying the classes that playa role in achieving system goals and requirements is a major
activity of object-oriented analysis) Each class must have a purpose.
Every class should be clearly defined and necessary in the context of achieving the system's
goals.
If you cannot formulate a statement of purpose for a class, simply eliminate it.
The classes that add no purpose to the system have been deleted from the list.
BankClient class: A client is an individual that has a checking account and, possibly, a savings
account.
Bank class: Bank clients belong to the Bank. It is a repository of accounts and processes the
accounts' transactions.
Account class: An Account class is a formal (or abstract) class, it defines the common behaviors that
can be inherited by more specific classes such as CheckingAccount and SavingsAccount.
CheckingAccount class: It models a client's checking account and provides more specialized
withdrawal service. .
savingsAccount class: It models a client's savings account. Transaction class: Keeps track of
transaction, time, date, type, amount, and 'balance.
Common Class Pattern Approach :
The second method for identifying classes is using common class patterns,
which is based on a knowledge base of the common classes.
They have compiled and listed the following patterns for finding the
candidate class and object :
Name.Concept class Context:
The concept class encompasses principles that are not tangible but used to organize or
keep track of business activities or communications.
Marin and Odell describe concepts elegantly, ”Privately held ideas or notions are called
conceptions.
To communicate with others, we must share our individually held conceptions andarrive
at agreed concepts.” Furthermore, Martin and Odell explain that, without concepts,
mental life would be total chaos since every item we encountered would be different.
Example.Performance is an example of concept class object.
Name.Events class Context:
Things happen, usually to something else at a given date and time or as a step in an
ordered sequence.
Associated with things remembered are attributes (after all, the things to remember
are objects) such as who, what, when, where, how, or why. Example.Landing,
interrupt, request, and order are possible events.
Name.Organization class Context: .
Name.People class (also known as person, roles, and roles played class) Context.
The people class represents the different roles users play in interacting with the
application.
This class includes physical objects or groups of objects that are tangible
and devices with which the application interacts.
Example. Cars are an example of tangible things, and pressure sensors are
an example of devices.
Use-case Driven Approach:
The use cases are employed to model the scenarios in the system and specify what external
actors interact with the scenarios.
Once the system has been described in terms of its scenarios, the modeler can
examine the textual description or steps of each scenario to determine what objects
are needed for the scenario to occur.
However, this is not a magical process in which you start with use cases, develop a
sequence diagram, and voila, classes appear before your eyes.
The process of creating sequence or collaboration diagrams is a systematic way to think about how a
use case (scenario) can take place; and by doing so, it forces you to think about objects involved in
your application.
When building a new system, designers model the scenarios of the way the system of business
should work.
When redesigning an existing system, many modelers choose to first model the scenarios of the
current system, and then model the scenarios of the way the system should work.
i) Implementation Of Scenarios:
The UML specification recommends that at least one scenario be prepared for each significantly
different use-case instance.
Each scenario shows a different sequence of interaction between actors and the system, with all
decisions definite. In essence, this process helps us to understand the behavior of the system's
objects.
When you have arrived at the lowest use-case level, you may create a child
sequence diagram or accompanying collaboration diagram for the use case.
With the sequence and collaboration diagrams, you can model the implementation
of the scenario.
When you have arrived at the lowest use-case level, you may create a child
sequence diagram or accompanying collaboration diagram for the use case.
With the sequence and collaboration diagrams, you can model the implementation
of the scenario.
As explained in a sequence diagram, the objects involved are drawn on the diagram as a
vertical dashed line, with the name of the objects at the top.
Horizontal lines corresponding to the events that occur between objects are drawn between
the vertical object lines.
The event lines are drawn in sequential order, from the top of the diagram to the bottom.
They do not necessarily correspond to the steps defined for a usecase scenario.
Actor
Class
Synchronous message
Asynchronous message
Focus of Control
Return message
Termination
lifeline
Classes, Responsibilities, and Collaborators :(Crc) Approach :
Classes, Responsibilities, and Collaborators is more a teaching technique than a method for
identifying classes.
Classes, Responsibilities, and Collaborators cards are 4" X 6" index cards. All the information
for an object is written on a card, which is cheap, portable, readily available, and familiar.
Figure shows an idealized card. The class name should appear in the upper left-hand corner,
a bulleted list of responsibilities should appear under it in the left two thirds of the card, and
the list of collaborators should appear in the right third.
Classes, Responsibilities, and Collaborators cards place the designer's focus on the
motivation for collaboration by representing (potentially) many messages as phrases of
English text.
Classes, Responsibilities, And Collaborators Process The Classes, Responsibilities, and
Collaborators process consists of three steps
2. Assign responsibilities.
3. Identify collaborators
Classes are identified and grouped by common attributes, which also provides candidates for
super classes.
The class names then are written onto Classes, Responsibilities, and Collaborators cards. The
card also notes sub- and super classes to show the class structure.
The application's requirements then are examined for actions and information associated with
each class to find the responsibilities of each class.
Next, the responsibilities are distributed; they should be as general as possible and placed as
high as possible in the inheritance hierarchy.
The idea in locating collaborators is to identify how classes interact. Classes (cards) that have
a close collaboration are grouped together physically.
Iden tify
Classes
resp onsib ility
Iterate
By the convention, the class name must begin with an upper case letter.
For compound words, capitalize the first letter of each word - for example,
LoanWindow.
Associations:
A reference from one class to another is an association.
Basically a dependency between two or more classes is an association.
For example, Jackie works for John.
Some associations are implicit or taken from general knowledge.
Guidelines For Identifying Associations
Customer Operator
Order
Eliminate Unnecessary Associations:
Implementation association. Defer implementation-specific associations to
the design phase.
Since they are redundant you should avoid these types of association.
Grandparent of Ken can be defined in terms of the parent association.
Grand Parent
John of Ken
Parent Parent
of Brian of
John Ken
Superclass-Subclass Relationships:
Recall that at the top of the class hierarchy is the most general class, and from it
descend all other, more specialized classes.
At the same time do not create very specialized classes at the top of hierarchy.
Multiple inheritance brings with it complications such as how to determine which behavior to
get from which class, particularly when several ancestors define the same method.
One way of achieving the benefits of multiple inheritance is to inherit from the most
appropriate class and add an object of another class as an attribute.
A Part of Relationships-aggregation
A-part-of relationship, also called aggregation, represents the situation where a class consists
of several component classes.
A class that is composed of other classes does not behave like its parts; actually, it behaves
very differently. For example, a car consists of many other classes, one of which is a radio,
but a car does not behave like a radio
Two major properties of a-part-of relationship are transitivity and anti
symmetry,
Does the part class capture more than a single value? (If it captures only a single value, then
simply include it as an attribute with the whole class.)
For example, one might represent aggregation such as container and collection as hollow diamonds,
and use a solid diamond to represent composition, which is a strong form of aggregation.
A house is a container