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

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

Major and Minor Elements of the Object Model


Major Elements
• Abstraction
• Encapsulation
• Modularity
• Hierarchy

Minor Elements
• Typing
• Concurrency
• Persistence

Elements of an Object Model:


5
23CS202-Object Oriented Analysis and Design
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”

• E.g., When a class Student is designed, 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
23CS202-Object Oriented Analysis and Design

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
Real Life Example

Properties of Good Abstraction


• Should be well named,
coherent, accurate, complex
and have only
Module 1 - Object Models 7
the
23CS202-Object Oriented Analysis and Design

Abstraction
Categories of Abstraction
• Entity Abstraction - An object that represents a useful model of a problem
domain or solution domain entity
• 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

Module 1 - Object Models 8


23CS202-Object Oriented Analysis and Design

Encapsulation
• Process of binding both attributes and methods together within a class
• Through encapsulation, the internal details of a class can be hidden from
outside
• The class has methods that provide user interfaces by which the services
provided by the class may be used
• E.g.,

Module 1 - Object Models 9


23CS202-Object Oriented Analysis and Design

Encapsulation
• Aids in data hiding by providing access to an object’s data only through
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.,

Module 1 - Object Models 10


23CS202-Object Oriented Analysis and Design

Modularity
• Process of decomposing a problem (program) into a set of modules so as to 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

Module 1 - Object Models 11


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
Definition by Grady Booch
• “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”

Module 1 - Object Models 14


23CS202-Object Oriented Analysis and Design

Hierarchy
Types of Hierarchies
“IS–A” Hierarchy
• Defines the relationship in inheritance (generalization/
hierarchical
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
Module 1 - Object Models 15
23CS202-Object Oriented Analysis and Design

Typin
• According to the theories of abstractgdata type, a type is a characterization of 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

Module 1 - Object Models 16


23CS202-Object Oriented Analysis and Design

Typin
Types of Typing 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
Module 1 - Object Models 17
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 that exists between executions of a program
 Data that exists between various versions of a program
 Data that outlives the program

Module 1 - Object Models 21


23CS202-Object Oriented Analysis and Design

Applications of the Object Model


• Air Traffic Control
• Animation
• Business or Insurance Software
• Business Data Processing
• CAD
• Databases
• Expert Systems
• Office Automation
• Robotics
• Telecommunication
• Telemetry System, etc…

22
23CS202-Object Oriented Analysis and Design

Try Yourself

1. Identify the feature which can be implemented using encapsulation.


a) Abstraction
b) Encapsulation
c) Inheritance
d) Polymorphism
2. Which of the following language was developed as the first purely object
programming language?
a) SmallTalk
b) C++
c) Kotlin
d) Java 23
23CS202-Object Oriented Analysis and Design

3. Which two features of object-oriented programming are the same?


a) Abstraction and Polymorphism features are the same
b) Inheritance and Encapsulation features are the same
c) Encapsulation and Polymorphism features are the same
d) Encapsulation and Abstraction
4. is the property that distinguishes an active object from one that is not active.
5. is the ranking or ordering of abstraction”.

Module 1 - Object Models 24


23CS202-Object Oriented Analysis and Design

Session 3 - Unified Process

Module 1 - Object Models 25

You might also like