You are on page 1of 21

UNIT- II

CHAPTER IN BOOK- 7
DAY- 15

-K. Indhu
SYLLABUS COVERED HERE
• Classification
• Common Class Patterns Approach
• Use Case Driven Approach
• CRC Approach

31-JAN-14 K. INDHU 2
GOALS
• Common Class Patterns Approach
1. Concepts
2. Events
3. Organization, 4. Places
5. People
6. Tangible Things and Devices
• Use Case Driven Approach
• CRC Approach
• General Guidelines for naming Classes

5-FEB-14 K. INDHU 3
COMMON CLASS PATTERNS APPROACH
• This approach is based on the knowledge-base of the common
classes that have been proposed by various researchers.

• They have compiled and listed the following patterns for finding
the candidate class and object:-

1. Name. Concept class


2. Name. Events class
3. Name. Organization class
4. Name. People class
5. Name. Places class
6. Name. Tangible things and devices class

5-FEB-14 K. INDHU 4
CANDIDATE CLASSES - CONCEPTS
• A Concept is a particular idea or understanding
that we have of our world.

• Concept Class are principles or ideas that are not


tangible but used to organize or keep track of
business activities and/or communications.

• For example Performance is an example of


concept class.

5-FEB-14 K. INDHU 5
CANDIDATE CLASSES - EVENTS
• Events classes are points in time that must be
recorded and remembered.

• Things happen, usually to something else, at a


given date and time, or as a step in an ordered
sequence.

• For example Order, Request are possible Event


Classes, that must be remembered.

5-FEB-14 K. INDHU 6
CANDIDATE CLASSES - ORGANIZATION
• An organization class is a collection of people,
resources, facilities or groups to which the users belong.

• For example, accounting department might be


considered as a potential class.
CANDIDATE CLASSES - PLACES
• Places are physical locations that the system must
keep information about.

• For example, Buildings, Stores, Library, Office are


examples of Places Class, that can be remembered.
5-FEB-14 K. INDHU 7
CANDIDATE CLASSES – PEOPLE
•The People class represents the different roles users play in
interacting with the application.

•A Scientist- Coad & Yourdon explains that a class which is


represented by a person can be divided into two types:-

1. Those representing users of the system, such as an operator,


or a clerk; who interacts with the system.

2. Those representing people who do not use the system but


about whom information is kept by the system.

•For example Employee, Client, Teacher, Manager are examples of


People Class.

5-FEB-14 K. INDHU 8
CANDIDATE CLASSES –
TANGIBLE THINGS & DEVICES

•This class includes physical (tangible) objects or


groups of objects with which the application interacts.

•This class includes TANGIBLE and DEVICES.

•For example-
1. Cars,
2. Pressure-Sensors
•are all examples of Devices class.

5-FEB-14 K. INDHU 9
COMMON CLASS PATTERNS APPROACH
- ATM

1. Events->
1. Account Class
2. Checking Account Class
3. Savings Account Class

2. Organization->
1. Bank Class
3. People->
1. Bank Client Class
4. Place->
1. N/A
5. Tangible Things & Devices->
1. ATMMachine Class

05-FEB-14 K. INDHU 10
USE CASE DRIVEN APPROACH
• Modeling with use cases is a recommended aid in finding the objects of
a system.
• This is the technique used by the unified approach.

1. Once the system has been described in terms of its scenarios, we can
examine the textual description or steps of each scenario to determine
what objects are needed for the scenario to occur.

2. To identify objects of a system and their behaviors, the lowest level of


executable use cases is further analyzed with a sequence and
collaboration diagram pair.

3. By walking through the steps, you can determine what objects are
necessary for the steps to take place.

05-FEB-14 K. INDHU 11
USE CASE DIAGRAM- ATM- I

05-FEB-14 K. INDHU 12
USE CASE DIAGRAM- ATM- II

05-FEB-14 K. INDHU 13
SEQUENCE DIAGRAM- ATM (SHORT)

05-FEB-14 K. INDHU 14
SEQUENCE DIAGRAM- ATM (DETAILED)

05-FEB-14 K. INDHU 15
COLLABORATION DIAGRAM- ATM

05-FEB-14 K. INDHU 16
CRC CARDS APPROACH
1. CRC stands for Class, Responsibilities and
Collaborators, developed by Cunningham, Wilkerson
and Beck.

2. CRC can be used for identifying classes and their


responsibilities, therefore their attributes and
methods.

3. By identifying an object’s responsibilities and


collaborators, one can identify it’s attributes and
methods.

05-FEB-14 K. INDHU 17
COLLABORATIONS
• An object can accomplish either a certain
responsibility itself, or it may require the
assistance of other objects.
• If it requires an assistance of other objects, it
must collaborate with those objects to fulfill its
responsibility.

05-FEB-14 K. INDHU 18
CRC CARDS APPROACH
• CRC cards are 4" x 6" index cards.
• All the information for an object is written on a card.
• CRC starts with only one or two obvious cards.
• If the situation calls for a responsibility not already covered by
one of the objects:-
– Add, or
– Create a new object to address that responsibility.

05-FEB-14 K. INDHU 19
GENERAL GUIDELINES
- FOR NAMING CLASSES

• The class should describe a single object, so it should be the


singular form of noun.

• Use names that the users are comfortable with.

• The name of a class should reflect its intrinsic nature.

• 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, BankClient.

05-FEB-14 K. INDHU 20
HAPPY LEARNING!!!

You might also like