You are on page 1of 18

UNIT- II

CHAPTER IN BOOK- 7
DAY- 14

-K. Indhu
SYLLABUS COVERED HERE
• Classification
• Noun Phrase Approach

4-FEB-14 K. INDHU 2
GOALS
• Classification Theory
• Classification Final Definition
• Approaches for Identifying Classes
• Noun Phrase Approach
• Guidelines for Identifying Classes
• Guidelines for Refining Classes

4-FEB-14 K. INDHU 3
CLASSIFICATION
• Classification is the process of:-
– -> checking to see if an object belongs to a category or a class,

is regarded as a basic attribute of human nature.

• TWO POINTS TO REMEMBER:-


• A class is a specification of structure, behavior and the
description of an object.

• Classification is more concerned with identifying classes


than identifying the individual objects in a system.

4-FEB-14 K. INDHU 4
CLASSIFICATION
• THE CHALLENGE OF
CLASSIFICATION:-
• Intelligent classification is
intellectually hard work and
may seem rather arbitrary.
• Martin and Odell have
observed in object-oriented
analysis and design, that-
• “In fact, an object can be
categorized in more than
one way.”

4-FEB-14 K. INDHU 5
CLASSIFICATION
• DEFINITION for CLASSIFICATION:-
• Classification can be defined as:-
• the categorization of input data(things)
• into
• identifiable classes
• through
• the extraction of significant features of
attributes of the data from a background of
irrelevant detail.

4-FEB-14 K. INDHU 6
APPROACHES FOR IDENTIFYING CLASSES
• There are four alternative approaches for
identifying classes as below:-
1. The noun phrase approach,
2. The common class patterns approach,
3. The use-case driven approach,
4. The class responsibilities collaboration (CRC)
approach.

• We can always combine the above approaches


to identify classes for a given problem.

4-FEB-14 K. INDHU 7
NOUN PHRASE APPROACH
• The noun phrase approach was proposed by-
– (i) Rebecca Wirfs-Brock,
– (ii) Brian Wilkerson and,
– (iii) 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.

4-FEB-14 K. INDHU 8
NOUN PHRASE APPROACH
• All plurals are changed to singular, the nouns are
listed and the list is divided into three
categories:-
– (i) Relevant Classes,
– (ii) Fuzzy Classes (the “fuzzy area”, classes we are not
sure about),
– (iii) Irrelevant Classes.

4-FEB-14 K. INDHU 9
NOUN PHRASE APPROACH
• It is safe to scrap the Irrelevant Classes- which
either have no purpose or will be unnecessary.

• We must be able to formulate a statement of


purpose for each candidate class; if not, simply
eliminate it.

• We must then select candidate classes from the


other two categories.

4-FEB-14 K. INDHU 10
GUIDELINES- FOR IDENTIFYING CLASSES
• The following are guidelines for selecting Classes in
your application:-
1. Look for nouns and noun phrases in the problem
statement.
2. Some classes are implicit or taken from general knowledge.
3. All classes must make sense in the application domain.
4. Carefully choose and define class names.
• As Booch pointed out, “Intelligent classification
(identifying classes) is intellectually hard work and it
best comes about through an incremental and iterative
process.”

4-FEB-14 K. INDHU 11
GUIDELINES- FOR REFINING CLASSES
• The following are guidelines help in selecting candidate
classes from the relevant and fuzzy categories of class
in the problem domain:-

1. 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.

4-FEB-14 K. INDHU 12
GUIDELINES- FOR REFINING CLASSES
2. ADJECTIVE CLASSES:-
• 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, If Adult Membership and Youth


Membership behave differently, than they should be
classified as different classes.

4-FEB-14 K. INDHU 13
GUIDELINES- FOR REFINING CLASSES
3. ATTRIBUTE CLASSES:-
• Tentative objects which are used only as values should be
defined or restated as attributes and not as a class.
• For example, Client-Status and demographics of Client are not
classes but attributes of the Client class.

4. IRRELEVANT CLASSES:-
• Each class must have a purpose and every class should be
clearly defined and necessary.
• We must formulate a statement of purpose for each candidate
class.
• If you cannot come up with a statement of purpose for any
class, simply eliminate the candidate class.

4-FEB-14 K. INDHU 14
GUIDELINES- FOR REFINING CLASSES
• It is to be remembered that this is an incremental
process.
• Some classes will be missing, others will be eliminated or
refined later.
• Thus the process of identifying relevant classes and
eliminating irrelevant classes is an incremental process.

• Classification is the essence of good object oriented


analysis and design.
• We must continue this refining cycle throughout the
development process until we are satisfied with the
results.

4-FEB-14 K. INDHU 15
GUIDELINES- FOR REFINING CLASSES

4-FEB-14 K. INDHU 16
NOUN PHRASE APPROACH- ATM
• The following are the different class names that are
being used to refer different concepts:-
1. ATM Card, Card = ATM Card
2. ATM Machine Class
3. Client, BankClient = BankClient Class
4. Bank Class
5. Account, Client’s Account = Account Class
6. Checking, Checking Account = Checking Account Class
7. Savings, Savings Account = Savings Account Class
8. Transaction Class

4-FEB-14 K. INDHU 17
HAPPY LEARNING!!!

You might also like