0% found this document useful (0 votes)
28 views13 pages

OO Modelling

Uploaded by

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

OO Modelling

Uploaded by

abeni mesfin
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 13

Simulation and Modelling

Object Oriented Modelling

Compiled By:
Hayelom M. (PhD Student at UESTC, China)
Components of OOP
• Encapsulation
– Is the process of binding both attributes and methods together
within a class.
– Through encapsulation, the internal details of a class can be
hidden from outside.
– It permits the elements of the class to be accessed from
outside only through the interface provided by the class.
• Polymorphism
– In object-oriented paradigm, polymorphism implies using
operations in different ways, depending upon the instance
they are operating upon.
– Polymorphism allows objects with different internal
structures to have a common external interface.
– Polymorphism is particularly effective while implementing
inheritance.
Inheritance
• Inheritance is the mechanism that permits new classes
to be created out of existing classes by extending and
refining its capabilities.
• The existing classes are called the base classes/parent
classes/super-classes, and the new classes are called
the derived classes/child classes/subclasses.
• The subclass can inherit or derive the attributes and
methods of the super-class(es) provided that the
super-class allows so.
• Besides, the subclass may add its own attributes and
methods and may modify any of the super-class
methods.
• Inheritance defines an “is – a” relationship.
Class
• A class represents a collection of objects having
same characteristic properties that exhibit common
behavior. It gives the blueprint or description of the
objects that can be created from it. Creation of an
object as a member of a class is called instantiation.
Thus, object is an instance of a class.
• The constituents of a class are −
– A set of attributes for the objects that are to be instantiated
from the class. Generally, different objects of a class have
some difference in the values of the attributes. Attributes
are often referred as class data.
– A set of operations that portray the behavior of the objects
of the class. Operations are also referred as functions or
methods.
• A class is represented by a rectangle having three sections −
• The top section containing the name of the class
• The middle section containing class attributes
• The bottom section representing operations of the class
• The visibility of the attributes and operations can be represented in
the following ways −
• Public − it is prefixed by the symbol ‘+’.
• Private − it is prefixed by the symbol ‘−’.
• Protected − It is prefixed by the symbol ‘#’.

Class representation
Object
• An object is a real-world element in an object–oriented
environment that may have a physical or a conceptual
existence. Each object has −
– Identity that distinguishes it from other objects in the
system.
– State that determines the characteristic properties of an
object as well as the values of the properties that the object
holds.
– Behavior that represents externally visible activities
performed by an object in terms of changes in its state.
• Objects can be modelled according to the needs of the
application.
• An object may have a physical existence, like a
customer, a car, etc.; or an intangible conceptual
existence, like a project, a process, etc
• An object is represented as a rectangle with two sections −
• The top section contains the name of the object with the name of the
class or package of which it is an instance of. The name takes the
following forms −
– object-name − class-name
– object-name − class-name :: package-name
– class-name − in case of anonymous objects
• The bottom section represents the values of the attributes. It takes the
form attribute-name = value.
• Sometimes objects are represented using rounded rectangles.

• Object Representation
Object Diagram

• Class diagram of the Banking System.


Object modelling
• The process of object modelling can be
visualized in the following steps −
– Identify objects and group into classes
– Identify the relationships among classes
– Create user object model diagram
– Define user object attributes
– Define the operations that should be performed on
the classes
– Review glossary
Dynamic modelling
• The process of dynamic modelling can be
visualized in the following steps −
– Identify states of each object
– Identify events and analyze the applicability of
actions
– Construct dynamic model diagram, comprising of
state transition diagrams
– Express each state in terms of object attributes
– Validate the state–transition diagrams drawn
Cont..

• The dynamic model represents the time–


dependent aspects of a system. It is concerned
with the temporal changes in the states of the
objects in a system. The main concepts are −
– State, which is the situation at a particular condition
during the lifetime of an object.
– Transition, a change in the state
– Event, an occurrence that triggers transitions
– Action, an uninterrupted and atomic computation
that occurs due to some event, and
– Concurrency of transitions.
• A state machine is graphically represented
through a state transition diagram.
Benefits of Object Model
• The benefits of using the object model are −
– It helps in faster development of software.
– It is easy to maintain. Suppose a module
develops an error, then a programmer can fix
that particular module, while the other parts of
the software are still up and running.
– It supports relatively hassle-free upgrades.
– It enables reuse of objects, designs, and
functions.
– It reduces development risks, particularly in
integration of complex systems.
Q&A

I Thank You

You might also like