Lecture 4
Lecture 4
with an understanding of the user and system creatively to capture the system classes.
Good classes reflect the problem domain and have real names
IDENTIFYING CLASSES
Questions we can ask:
What is the information that should be stored or analyzed?
Are there external systems? -- The external system might be seen as classes that your system
contains or should interact with.
Are any reusable patterns, class libraries, or components? (Go there to look for class
candidates)
Are there devices that the system must handle?
Are there any organizational parts? Representing an organization can be done with classes,
especially in business models.
Which roles do the actors in the business play? These roles can be seen as classes, such as
user, system operator, customer, and so on.
IDENTIFYING CLASSES
Find concepts from the textual descriptions of the problem domain according to
concept category list.
Concepts and objects (things) can be divided into different categories
according to their nature of its instances.
The concept category list given (next slide) has been found useful in
identifying concepts.
CV C e rtific a te s
LET US TRY IT
Use Object-Oriented system analysis and design approach with UML to develop
a Dynamic Web-Based Management System for TFF. The system should
provide means of searching information of matches using any criteria. It should
display information on match prices based on playground and stadium stages
available and provide information on payment procedures.
CLASS DIAGRAMS
A class diagram depicts classes and their interrelationships
Used for describing structure and behavior in the use cases
Provide a conceptual model of the system in terms of entities and their relationships
Used for requirement capture, end-user interaction
Detailed class diagrams are used for developers
CLASS DIAGRAM
Each class is represented by a rectangle subdivided into three compartments
Name
Attributes
Operations
CLASS DIAGRAM – NAME
COMPARTMENT
The top compartment of the class rectangle contains the name of the class
The name should be derived from the problem domain and should be as unambiguous as
possible
The class name should be a noun
CLASS DIAGRAM –
ATTRIBUTES COMPARTMENT
Classes have attributes that describe the characteristics of the objects
Only the attributes that are interesting within the system being modelled should be included.
CLASS DIAGRAM –
OPERATIONS
Operations manipulate the attributes or perform other actions.
Operations are normally called functions, but they are inside a class and can be applied only to
objects of that class.
An operation is described with a return-type, a name, and zero or more parameters.
VISISBILITY
Modifiers are used to indicate visibility of attributes and operations.
‘+’ is used to denote Public visibility (everyone)
‘#’ is used to denote Protected visibility (derived)
‘-’ is used to denote Private visibility (no one)
RELATIONSHIPS BETWEEN
CLASSES
The relationships that can be used are:
associations,
generalizations,
dependencies, and
abstractions/realizations.
CLASS RELATIONSHIP:
GENERALIZATION
Example:
Supertype Customer
Regular Loyalty
Customer Customer
Subtype1 Subtype2
Composition
Class P2
Also models the part–whole relationship but, in addition, Every
Class P1
part may belong to only one whole, and If the whole is
deleted, so are the parts
Part Classes
[From Dr.David A. Workman]
Example:
Example A number of different chess boards: Each square belongs to only
one board. If a chess board is thrown away, all 64 squares on that
board go as well.
Figure 16.7
The McGraw-Hill Companies, 2005
AGGREGATION
Container Class
Class C
Aggregation:
• expresses a relationship among instances of
AGGREGATION
related classes. It is a specific kind of
Container-Containee relationship.
Class E1 Class E2
Aggregations
may form "part of" the association but may not be essential to it. They
may also exist independent of the aggregate. e.g., Apples may exist
independent of the bag.
CLASS ACTIVITY
Think about the current LMS being used at the university. Identify important concepts that can
be represented as classes.
Draw a class diagram including attributes, operations and relationships
QUESTIONS?