Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

23CS202-Object Oriented Analysis and Design

Module1:Object Oriented Model


Title of Topic: Object Oriented Basics
Course Code: 23CS202
Course Title: Object Oriented Analysis and
Design
Session Number: 2
Academic Year: 2023 - 2024 (Even Sem)
23CS202-Object Oriented Analysis and Design
Module 1 – Object Oriented Model

1. Introduction to OOAD
2. Object Oriented Basics
3. Unified Process
4. Classes and Objects: Object and Class Relationships
5. Building Quality Classes and Objects: Measuring Quality, Choosing Operations
6. Classification: Importance and Challenges - Incremental and Iterative Classification
7. Approaches for Identifying Classes and Objects: Classical and Modern
8. Key Abstractions and Mechanisms
9. Complexity - Structure and Attributes of Complex System
10. Designing Complex Systems
11. Application case study : Inventory Management in visual Paradigm and Enterprise
Architect.
CO1 Describe the structure & attributes for designing complex systems
23CS202-Object Oriented Analysis and Design

Elements of an Object Model


Topics to be Covered
• Kinds of Programming Paradigms
• Major and Minor Elements of the Object Model
• Abstraction
• Encapsulation
• Modularity
• Hierarchy
• Typing
• Concurrency
• Persistence
• Applications of the Object Model
23CS202-Object Oriented Analysis and Design

Kinds of Programming Paradigms


• According to Jenkins and Glasgow, “most programmers work in one language and
use only one programming style”
•They have not been exposed to alternate ways of thinking about a problem •
Programming style is a way of organizing programs on the basis of some conceptual
model of programming and an appropriate language to make programs written in the
style clear
Five Main Kinds of Programming Styles
• Procedure-oriented – Algorithms for design of computation
• Object-oriented - Classes and objects
• Logic-oriented - Goals, often expressed in a predicate calculus
23CS202-Object Oriented Analysis and Design

•Rule-oriented - If–then rules for design of knowledge base •


Constraint-oriented - Invariant relationships
Major and Minor Elements of the Object Model
Major Elements
• Abstraction
• Encapsulation
• Modularity
• Hierarchy

Minor Elements
• Typing
• Concurrency
23CS202-Object Oriented Analysis and Design

• Persistence

Elements of an Object Model:

Abstraction
• Focus on the essential features of an element or object in OOP, ignoring its
inessential or accidental properties
• The essential features are relative to the context in which the object is being
used
Definition by Grady Booch
• “An abstraction denotes the essential characteristics of an object that distinguish it
from all other kinds of objects and thus provide crisply defined conceptual
boundaries, relative to the perspective of the viewer”
• 23CS202-Object
E.g., When aOriented Analysis is
class Student anddesigned,
Design the attributes enrolment_number, name,

course, and address are included while characteristics like pulse_rate and
size_of_shoe are eliminated, since they are irrelevant in the perspective of the
educational institution

Abstraction
• Provides a mechanism for managing and communicating complexity of the
system
• Aids in reuse and encapsulation
• Permits us to concentrate on similarities between objects
23CS202-Object Oriented Analysis and Design

Real Life Example


Properties of Good Abstraction
• Should be well named, coherent,
accurate, complex and have only
the
minimal details of the entity Abstraction
Categories of Abstraction
• Entity Abstraction - An
object that represents a
useful model of a problem
domain or solution domain
entity
23CS202-Object Oriented Analysis and Design

• Action Abstraction - An object that provides a generalized set of operations, all of


which perform the same kind of function
• Virtual Machine Abstraction - An object that groups operations that are all used by
some superior level of control, or operations that all use some junior-level set of
operations
• Coincidental Abstraction - An object that packages a set of operations that have
no relation to each other

Encapsulation
•Process of binding both attributes and methods together within a class •
Through encapsulation, the internal details of a class can be hidden from
23CS202-Object Oriented Analysis and Design

outside
• The class has methods that provide user interfaces by which the services
provided by the class may be used
• E.g.,

Encapsulation
• Aids in data hiding by providing access to an object’s data only through
23CS202-Object Oriented Analysis and Design

operations it offers
• Called as an external interface which provides a set of methods that accepts
and responds to a particular kind of message

• E.g.,

Modularity
• Process of decomposing a problem (program) into a set of modules so as to
23CS202-Object Oriented Analysis and Design
reduce the overall complexity of the problem
Definition by Grady Booch

• “Modularity is the property of a system that has been decomposed into a set of

cohesive and loosely coupled modules”


•These modules can be implemented, compiled and tested separately • They can be

linked together to form a complete executable program • Modularity is intrinsically


linked with encapsulation and can be visualized as
a way of mapping encapsulated abstractions into real, physical modules having
high cohesion within the modules and their inter-module interaction or coupling
is low
23CS202-Object Oriented Analysis and Design
Modularity
• Modularity is intrinsically linked with encapsulation and can be visualized as a way
of mapping encapsulated abstractions into real, physical modules having high
cohesion within the modules and their inter-module interaction or coupling is low
• Encapsulation and Modularity provide a bar around the Abstraction
23CS202-Object Oriented Analysis and Design

Definition by Grady Booch

Hierarchy

•“Hierarchy is the ranking or ordering of abstraction”


•Through hierarchy, a system can be made up of interrelated

subsystems, which can have their own subsystems and so on until


the smallest level components are reached
• Uses the principle of “divide and conquer”
23CS202-Object Oriented Analysis and Design

Hierarchy
Types of Hierarchies
“IS–A” Hierarchy
23CS202-Object Oriented Analysis and Design

• Defines the hierarchical relationship in inheritance (generalization/ specialization),


whereby from a super-class, a number of subclasses may be derived which may
again have subclasses and so on
• E.g., if we derive a class Rose from a class Flower, we can say that a rose “is–a”
flower
“PART–OF” Hierarchy
• Defines the hierarchical relationship in aggregation by which a class may be
composed of other classes
• E.g., a flower is composed of sepals, petals, stamens, and carpel. It can be
said that a petal is a “part–of” flower

Typing
• According to the theories of abstract data type, a type is a characterization of
23CS202-Object Oriented Analysis and Design

a set of elements
• In OOP, a class is visualized as a type having properties distinct from any
other types
• Typing is the enforcement of the notion that an object is an instance of a single
class or type
• It also enforces that objects of different types may not be generally interchanged;
and can be interchanged only in a very restricted manner if absolutely required to do
so
23CS202-Object Oriented Analysis and Design

Types of Typing Typin


g
Strong Typing
• Here, the
operation on an
object is checked
at the time of
compilation, as
in
the
programming
language Eiffel
• This type of binding variables to their type is called as static binding or early
binding and is fast but rigid
Weak Typing
• Here, messages may be sent to any class
• The operation is checked only at the time of execution, as in the programming
23CS202-Object Oriented Analysis and Design
Concurrency
Definition by Grady Booch
• “Concurrency is the property that distinguishes an active object from one that is not

active”
• Concurrency in operating systems allows performing multiple tasks or

processes simultaneously
• When a single process exists in a system, it is said that there is a single thread

of control
• However, most systems have multiple threads, some active, some waiting for CPU,

some suspended, and some terminated


23CS202-Object Oriented Analysis and Design

Concurrency
• Systems with multiple CPUs inherently permit concurrent threads of control; but
systems running on a single CPU use appropriate algorithms to give equitable CPU
time to the threads so as to enable concurrency
•In an object-oriented environment, there are active and inactive objects • The active
objects have independent threads of control that can execute concurrently with
threads of other objects
• The active objects synchronize with one another as well as with purely
sequential objects
• To maintain consistency between these parallel threads of execution, locking
mechanism is used
23CS202-Object Oriented Analysis and Design

Persistence
•An object occupies a memory space and exists for a particular period of time

• In traditional programming, the lifespan of an object was typically the lifespan of the
execution of the program that created it
• In files or databases, the object lifespan is longer than the duration of the
process creating the object
• This property by which an object continues to exist even after its creator
ceases to exist is known as persistence
23CS202-Object Oriented Analysis and Design

Persistence

• Different Types of Persistence Offered by Programming Languages


are:
✔ Maintenance of transient results in expression evaluation ✔
Maintenance of local variables in procedure activations ✔
Maintenance of global variables and heap items
✔ Data
Datathat
thatoutlives
existsthe
between
programexecutions of a program
✔ Data that exists between various versions of a program
23CS202-Object Oriented Analysis and Design

Applications of the Object Model


• Air Traffic Control
• Animation
• Business or Insurance Software
• Business Data Processing
• CAD
• Databases

You might also like