0% found this document useful (0 votes)
37 views22 pages

Class-Based Modeling Techniques Guide

Class-based modeling focuses on the structural view of object-oriented systems through class diagrams, which evolve from the problem domain to the implementation domain during development. Identifying classes is crucial and can be approached through various methods, such as the noun phrase approach and CRC approach. Guidelines for refining classes emphasize eliminating redundancies, defining clear purposes, and distinguishing between classes and attributes.

Uploaded by

rockerrrop
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views22 pages

Class-Based Modeling Techniques Guide

Class-based modeling focuses on the structural view of object-oriented systems through class diagrams, which evolve from the problem domain to the implementation domain during development. Identifying classes is crucial and can be approached through various methods, such as the noun phrase approach and CRC approach. Guidelines for refining classes emphasize eliminating redundancies, defining clear purposes, and distinguishing between classes and attributes.

Uploaded by

rockerrrop
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Class Based Modeling

6-Mar-24 Dept of I&CT 1


Class Modeling
• Class diagrams provide a structural view of systems.
• Class diagrams capture static structure of Object-Oriented systems, or how
they are structured rather than how they behave.
• Class diagram carry different information depending on the phase of the
development process and the level of detail being considered.
• Initially, class diagrams reflect the problem domain, which is familiar to end
users
• As development progresses, class diagrams move towards the implementation
domain, which is familiar to software engineers

6-Mar-24 Dept of I&CT 2


Class Modeling
• Identification of class is the most difficult part of the object-oriented analysis
and design.
• Classes are an important mechanism for classifying objects.
• Chief role of class is to define the attributes, methods, and applicability of its
instances.
• A class is a specification of structure, behavior, and the description of an
object.
• Classes are important because they create conceptual building blocks for
designing systems.

6-Mar-24 Dept of I&CT 3


Approaches for Identifying Classes
• The noun phrase approach.

• The class responsibilities collaboration (CRC) approach.

• The use-case driven approach.

• The common class patterns approach.

6-Mar-24 Dept of I&CT 4


Noun Phrase Approach
• Using this method, you must read through the interviews, requirements
specification and Use cases carefully, looking for noun phrases.
• Noun: a word (other than a pronoun) used to identify any of a class of people,
places, or things common noun, or to name a particular one of these proper
noun.
• Noun Phrase: a word or group of words containing a noun and functioning in a
sentence as subject, object, or prepositional object.
• E.g., I met Raj. (Raj is noun)
• E.g., I met your brother. (your brother is noun phrase)

6-Mar-24 Dept of I&CT 5


Noun Phrase Approach
• Change all plurals to singular and make a list, which can then be divided into
three categories.

1. Relevant classes
2. Fuzzy classes(class that are not sure about)
3. Irrelevant classes

6-Mar-24 Dept of I&CT 6


Noun Phrase Approach
• Initial list of noun phrases
• Eliminate irrelevant classes
• Reviewing redundant classes
• Review adjective classes
• Review possible attributes
• Review the class purpose

6-Mar-24 Dept of I&CT 7


Guidelines For Identifying Classes
• The followings are guidelines for selecting classes in your
application:
• Look for nouns and noun phrases in the problem statement.
• Some classes are implicit or taken from general knowledge.
• All classes must make sense in the application domain.
• Avoid computer implementation classes, defer it to the design stage.
• Carefully choose and define class names.

6-Mar-24 Dept of I&CT 8


Guidelines For Identifying Classes
• External Entities (e.g. other systems, devices, people)
• Things (e.g. reports, displays, letters, signals, results)
• Occurrences or Events (e.g. property transfer, fund transfer, robot movements)
• Roles (e.g. manager, engineer, salesperson)
• Organizational Units (e.g. division, group, team)
• Places (e.g. manufacturing floor, loading dock, back door)
• Structures (e.g. sensors, vehicles, computers)
• Not Objects/Attributes (e.g. number, type)

1. Identify potential classes and define attributes based on above mentioned points.
2. Then apply selection characteristics to retain with potential classes.

6-Mar-24 Dept of I&CT 9


Selection characteristics of Potential Classes
• Retained Information: information about class must be remembered so that the
system should function.
• Needed Services: must have set of identifiable operations that can change the
value of attributes in some way.
• Multiple Attributes: multiple attributes should be represented in the class
• Common Attributes: set of common attributes can be defined or applied to all
instances of that class.
• Common Operations: set of common operations can be defined or applied to
all instances of that class.
• Essential Requirements: information producing or consuming by external
entities should be considered as classes
6-Mar-24 Dept of I&CT 10
Guidelines For Refining Classes
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.

6-Mar-24 Dept of I&CT 11


Guidelines For Refining Classes
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 Senior Membership and Youth Membership behave
differently, then they should be classified as different classes.

6-Mar-24 Dept of I&CT 12


Guidelines For Refining Classes
Attribute Classes:
• Tentative objects which are used only as values should be defined or
restated as attributes and not as a class.
• For example, the demographics of Membership are not classes but
attributes of the Membership class.

6-Mar-24 Dept of I&CT 13


Guidelines For Refining Classes
Irrelevant Classes:
• Each class must have a purpose and every class should be clearly
defined and necessary.
• If you cannot produce a statement of purpose, simply eliminate the
candidate class.

6-Mar-24 Dept of I&CT 14


Identifying a list of candidate classes: Example 1

• Take a coherent, concise statement of the requirement of the system


• Underline its noun and noun phrases, that is, identify the words and phases the
denote things
• This gives a list of candidate classes, which we can then whittle down and
modify to get an initial class list for the system

6-Mar-24 Dept of I&CT 15


In this particular case we discard
• Library, because it is outside the scope of our system
• Short term loan, because a loan is really an event, which so far as we know is not a
useful object in this system
• Member of the library, which is redundant
• Week, because it is a measure, not a thing
• Item, because it is vague (we need to clarify it)
• Time, because it is outside the scope of the system
• System, because it is part of the meta-language of requirements description, not a part of
domain
• Rule, for the same reason

6-Mar-24 Dept of I&CT 16


This leaves:
• Book
• Journal
• Copy (of book)
• Library member
• Member of staff

6-Mar-24 Dept of I&CT 17


Example -2

6-Mar-24 Dept of I&CT 18


6-Mar-24 Dept of I&CT 19
6-Mar-24 Dept of I&CT 20
• Bank class

6-Mar-24 Dept of I&CT 21


Example -3
• The hospital has several wards divided into male wards & female wards. Each
ward has a fixed number of beds. When a patient is admitted they are placed
onto an appropriate ward. The Doctors In the hospital are organized into teams
such as Orthopedics A, or Pediatrics, and each team is headed by a consultant
doctor. There must be at least one grade 1 junior doctor in each team. The
Administration department keeps a record of these teams and the doctors
allocated to each team. A patient on award is under the care of a single team of
doctors, with the consultant being the person who is responsible for patient. A
record is maintained of who has treated the patient, and is must be possible to
list the patients on award and the patients treated by a articular team. Identify
the noun class

6-Mar-24 Dept of I&CT 22

You might also like