Professional Documents
Culture Documents
CH 4 Classes
CH 4 Classes
CH-4 CLASSES
Classes are the most important building block of an object
oriented system.
Name
Shape
origin Attributes
move( )
resize( ) Operations
display( )
CLASS
Terms and concepts
A class is a description of a set of objects that share the same
attributes, operations, relationships, and semantics.
NAME:-
Every class must have a name that distinguishes it from other
classes.
A name is a textual string. That name alone is known as a
Simple name; a path name is the class name prefixed by the
name of the package in which that class lives.
Simple Names
Business Rules:: Fraud Agent
Customer
name
Attributes
address
phone
birthDate
An attribute name may be text, just like a class name.
Wall
height: Float
Width: Float
Thickness: Float
isLoadBearing: Boolean= False
OPERATION:-
An operation is the implementation of a service that can be
requested from any object of the class to affect behavior.
add( ) Operations
grow( )
move( )
isEmpty( )
RESPONSIBILITIES:-
A responsibility is a contract or an obligation of the class.
Supplier
Responsibilities
-- Receive the order from the customer
--Supply the goods to the customer.
Common Modeling Techniques
1.Modeling the vocabulary of a system:-
Classes are used to model abstractions that are drawn from the
problem. Each of these abstractions is a part of the vocabulary
of the system.
For each class, provide the attributes and operations which are
required to handle the responsibilities.
Example: Retail system.