Unit 3 Ooad Notes
Unit 3 Ooad Notes
UNIT-III
Classification Theory:
Many persons introduced many theories for classification.
1. Booch: Classification guides us in making good decisions for modularization using the
property of sameness. The identified classes can be placed in same module or in different
module based on the sameness. Sameness/ Similarity can be measured with coupling and
cohesion. Cohesion is the measure of dependency between the
classes/packages/components in a module where coupling is the measure of dependency
between different modules. In real software development prefers weak coupling and
strong cohesion.
2. Martin and Odell: Classification can be used for well understanding of concept
[Building Blocks].These classes iteratively represent the refinement job during design.
Classes also act as an index to various implementations.
Classification Approaches:
Many approaches have been introduced for identifying classes in a domain. The most
used ones are
1. Noun Phrase Approach
2. Use – Case driven Approach
3. Common Class Approach
4. Class Responsibilities and Collaborators
The above diagram represents the format of a CRC card. It contains the class name and
responsibilities on the L.H.S compartment. Class name on the upper left most corner and
responsibilities in bulleted format. Class Name identifies the class and Responsibilities
represent the methods and attributes. Collaborators represent the other objects involved to
fulfill the responsibility of the object.
This information on the card helps the designer to understand the responsibilities and
collaborating classes.
The Process involves
• Identify classes.
• Identify responsibilities.
• Find out the collaborators and need.
• Create CRC card for each class identified.
The above diagram shows an example of a CRC card representing Account Class.
Its responsibility is to store information like Balance, Number and to have behaviors like
withdraw, deposit and getBalance.
Account class has 2 subclasses. They are Current Account and Savings Account. It also
collaborates with Transaction class to fulfill the responsibilities.
Association names make the association more informative. It is the label attached to the
line representing the association.
Association role is the role played the objects involved in the association. It is attached to
link representing the association.
The above diagram represents the association between the person and the company. The
association says that Person object works for a company object.
Association Name: Works for
In this association Company plays the role of employer and person plays the role of
employee.
Steps in identifying associations:
Associations are identified by analyzing the relationship among classes. The
dependencies are found out by analyzing the responsibilities of the class.
Answers for the following questions can be used to identify the associations.
1. Is the class capable of doing all its responsibilities?
2. If not what does it need?
3. What are the other class needed to fulfill the requirements?
Some cases the associations are explicit where in other cases they are identified from
general
knowledge.
Common Association Patterns:
These patterns and associations are group of associations identified by good expertise
persons and researchers.
For Example
• Location Pattern – associations of type next to, part of, contained in that represents
association with respect to the physical location. For e.g. tyre is a part of car.
• Communication Pattern – association of type talk to, order to that represents
associations with respect to communication. For e.g. driver turns the vehicle.
These patterns are maintained in the repository as groups and when a new association is
identified it is placed in the relevant group.
Guidelines for eliminating unnecessary associations:
1) Remove implementation associations _ separate those associations that represent
associations related to implementation. Postpone these issues to later stages of design or
initial
stages of coding.
2) Eliminate higher order associations by decomposing them into set of binary
associations.
Higher order associations increase the complexity where binary relations reduce
complexity by reducing the confusions and ambiguities.
3) Eliminate derived associations by representing them in simpler associations. For e.g.
Grand Parent Association can be represented in terms of two parent relationship. Hence it
is enough to deal the parent relationship and no grandparent relationship.
1. Super – Sub Class Relationship (Inheritance):-
Super – Sub class relationship known as generalization hierarchy. New classes can be
built from other classes hence the effort for creating new classes gets reduced. The newly
built class is called a derived class and the class from which the new class is built is
called Base Class.
This inheritance allows user to share the attributes and methods.
[ NOTE: Give one example]
2. 1. Identifying Actors:
Actor represents the role of a user with respect to the system. An user may play more
than one role. Analyst have to identify what are the roles played by the user and how they
use.
Actors can be identified using the following questions
1. Who is using the system?
2. Who is affected by the system?
3. Who affects the system?
4. What are the external systems used to fulfill the task?
5. What problems does this application solve and for whom?
6. How users use the system?
Jacobson provides two – three rule in identifying actors. i.e. start with 2 or 3 classes
(minimum) number of classes and refine on later iterations.
[ Note: State the ATM System domain and specify the actors found from the Case Study]
2. Developing a Simple Business Process Model
The entire set of activities that takes place in the domain are represented with the help of
a simple Business Process Model created with an UML activity diagram. This makes
each member of the team very familiar with the domain and overall activities that takes
place when a user uses the system in the domain.
3.
The above diagram represents the Business Process Model for an ATM System. It lists
out
following activities done by the user in an ATM Center.
1. User enters the ATM Center and inserts the card
2. He Enters the PIN
3. If he enters an incorrect PIN machine ask for correct PIN
4. User selects the type of Transaction
5. System Performs the Transaction
6. User collects the cash, card and leaves the ATM Center.
2. Develop use case model.
Use case diagram represents various requirements of the user. This use case model can be
used in most of the phases.
It consists of
a. Actors involved
b. Various Scenarios (Use Cases)
c. Communication between actors and use cases
d. Relation between various use cases
i. USES
ii. Extends
a. Actors: Actors represents the role played by the user with respect to the system. An
user may play
4. more than one role. Actors are represented by any of the three ways in UML
5.
6.
7.
64
3. Find out the common operations among the use cases and represent them as a
specialized use case.
Documentation:
Documentation is the effective way of communication between different developers/
team. This document reduces the gap between different phases/ team. The detailed
representation of
each work and product developed during various iterations of different phases are
written. Document
serves as a reference point for future reference.
Guidelines for Developing Effective Documentation:
1. Use common cover
2. Mind 80 – 20 rule while creating and referring documents.
3. Try only familiar terms in document.
4. Make document as short as possible.
5. Represent the document in an organized way.