0% found this document useful (0 votes)
5 views14 pages

3-1the Basic Concepts

1) An object is a representation of something in the application domain about which data is stored to enable the system to provide required functionality. Objects belong to classes and can represent physical, conceptual, organizational, or implementation features. 2) Each object has three characteristics - behavior, state, and identity. Behavior varies based on an object's state. Each object has a unique identity. 3) Encapsulation packages an object's related data and operations together, hiding internal details through a public interface of accessible names, classes, and operations. This protects an object's data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views14 pages

3-1the Basic Concepts

1) An object is a representation of something in the application domain about which data is stored to enable the system to provide required functionality. Objects belong to classes and can represent physical, conceptual, organizational, or implementation features. 2) Each object has three characteristics - behavior, state, and identity. Behavior varies based on an object's state. Each object has a unique identity. 3) Encapsulation packages an object's related data and operations together, hiding internal details through a public interface of accessible names, classes, and operations. This protects an object's data.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 14

A Student Guide to Object-

Orientated Systems

Objects and Classes: the basic concepts

1
What is an object?
The most important concept in object-
orientated development
A representation of something in the
application domain about which we need
to store data to enable the system to
provide the required functionality.

2
More about objects
Every object belongs to a class

Objects in an O-O system can represent

◦ physical things (customers, products,


members, and books),
◦ conceptual things (orders, loans, reservations
and cancellations)
◦ organizational things (companies or
departments).
◦ computer implementation features (GUI
windows, files or linked lists)
3
More about objects

Every object in a system has three


characteristics
 Behaviour, real world objects have
certain attributes and behaviour
 State, object behaviour may vary
depending on its state
 Identity, each object has a unique
identity and existence

4
Object characteristics – behaviour

Real world objects


Car has data and characteristic behaviour. Data –
amount of fuel, engine temperature, speed.
Behaviour – stop, start, move.
Object orientated objects
In OO data becomes attributes
Behaviour becomes operations (procedures)
Data and behaviour are packaged together

5
Object characteristics – state

An object’s state is determined by the value of


its attributes
e.g. Bank a/c with no overdraft allowed
Attribute determining state = balance

Value of balance attribute = £


£100
Behaviour –
Withdrawal of £90 allowed
Withdrawal of £150 denied
6
Object characteristics – identity

Every object has an identity


Every object is unique
Each object has a separate existence and
ultimately a separate space in memory
Objects whose attribute values are identical
are totally distinct from one another.

7
Identification Of Objects
 Many methodologists have their own
favorite approaches

 All techniques have short comings


fail to identify all objects
identifies false objects
Using The Things To Be Modeled
Basic Steps Are:
◦ Identify individual or group things, such as persons,
roles, organizations, logs, reports, forms, etc. in the
application domain
◦ Identify the corresponding objects and classes
Requires significant experience with OO to apply
successfully
Example for using the Technique
Flow of Events:
 The customer enters the store to buy a toy.
 It has to be a toy that his daughter likes and it must cost
less than 50 Euro.
 He tries a videogame, which uses a data glove and a
head-mounted display. He likes it.
 An assistant helps him.
 The suitability of the game depends on the age of the
child.
 His daughter is only 3 years old.
 The assistant recommends another type of toy, namely
the boardgame “Monopoly".
Customer
Toy Store
Cost
Age

VideoGame BoardGame

Accessory

11
Generating a Class Diagram from Flow of Events
Customer Flow of events:
customer
 The customer enters
enters the store to buy astore
toy. It has
store
? to bebuy
a toy thattoy
his daughter likes and it must cost
less than 50 Euro. He
daughter
tries a videogame, which
enter() less than 50
uses a data glove videogame
and a head-mounted display. He
daughter
daughter likes it.
age

suitable
An assistant helps him. The suitability of the
Toy
* game depends on the age of the child. His
depends
daughter isage
only 3 years old. The assistant
price
buy() recommends another type of toy, namely a
like() boardgame. The customer buy the game and
leaves
type ofthe
toystore boardgame
videogame boardgame
Encapsulation

Encapsulation - packaging related data and


operations together
Data hiding – making the internal details of
an object inaccessible to another object
Public interface – provides the services an
object makes available to other objects.

13
Encapsulation
Data inside an object is
surrounded by a
protective ring of
Operations operations
data The data is protected by
the operations that
encapsulate it.

Public interface – an object’s name, class and operations,


the only parts of the object accessible to other objects.

14

You might also like