0% found this document useful (0 votes)
12 views

Unit 1 - Concepts of Object Oriented Programming

Uploaded by

senthilnathans
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Unit 1 - Concepts of Object Oriented Programming

Uploaded by

senthilnathans
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

22CST201- OBJECT ORIENTED PROGRAMMING

DEPARTMENT OF COMPUTER SCIENCE ANDENGINEERING

LECTURE NOTES

II SEMESTER

22CST201 –OBJECT ORIENTED PROGRAMMING

Regulation – 2022
Academic Year 2023 – 2024(Even Semester)

Prepared by

Mr. S. Senthilnathan, AP / CSE

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

UNIT-1 CONCEPTS OF OBJECT ORIENTED PROGRAMMING


Syllabus
Abstract Data types – Inheritance – Polymorphism – Object Identity – Object Modeling – Object
Oriented Programming Languages – Object Oriented Databases – Object Oriented User Interfaces –
Object Oriented GIS – Object Oriented Analysis – Object Oriented Design

1.1 Abstract Data types

Abstract data type (ADT) is a concept or model of a data type. Because of ADT, a user doesn’t
have to bother about how that data type has been implemented. Moreover, ADT also takes care of
the implementation of the functions on a data type. Here, the user will have predefined functions on
each data type ready to use for any operation.

ADTs are a popular and important data type. Generally, ADTs are mathematical or logical concepts
that can be implemented on different machines using different languages. Furthermore, they’re very
flexible and don’t dependent on languages or machines.
There are mainly three types of ADTs:

1.1.1 List ADT


 The data is generally stored in key sequence in a list which has a head structure consisting
of count, pointers and address of compare function needed to compare the data in the list.
 The data node contains the pointer to a data structure and a self-referential pointer which points
to the next node in the list.

 The List ADT Functions is given below:


 get() – Return an element from the list at any given position.
 insert() – Insert an element at any position of the list.
 remove() – Remove the first occurrence of any element from a non-empty list.
 removeAt() – Remove the element at a specified location from a non-empty list.
 replace() – Replace an element at any position by another element.
 size() – Return the number of elements in the list.
 isEmpty() – Return true if the list is empty, otherwise return false.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

 isFull() – Return true if the list is full, otherwise return false.

1.1.2 Queue ADT


 The queue abstract data type (ADT) follows the basic design of the stack abstract data type.
 Each node contains a void pointer to the data and the link pointer to the next element in the
queue. The program’s responsibility is to allocate memory for storing the data.

 enqueue() – Insert an element at the end of the queue.


 dequeue() – Remove and return the first element of the queue, if the queue is not empty.
 peek() – Return the element of the queue without removing it, if the queue is not empty.
 size() – Return the number of elements in the queue.
 isEmpty() – Return true if the queue is empty, otherwise return false.
 isFull() – Return true if the queue is full, otherwise return false.

1.1.3 Stack ADT


 In Stack ADT Implementation instead of data being stored in each node, the pointer to data is
stored.
 The program allocates memory for the data and address is passed to the stack ADT.
 The head node and the data nodes are encapsulated in the ADT. The calling function can only
see the pointer to the stack.
 The stack head structure also contains a pointer to top and count of number of entries currently
in stack.

 push() – Insert an element at one end of the stack called top.


 pop() – Remove and return the element at the top of the stack, if it is not empty.
 peek() – Return the element at the top of the stack without removing it, if the stack is not empty.
 size() – Return the number of elements in the stack.
 isEmpty() – Return true if the stack is empty, otherwise return false.
 isFull() – Return true if the stack is full, otherwise return false.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

Advantages:
 Encapsulation: ADTs provide a way to encapsulate data and operations into a single unit,
making it easier to manage and modify the data structure.
 Abstraction: ADTs allow users to work with data structures without having to know the
implementation details, which can simplify programming and reduce errors.
 Data Structure Independence: ADTs can be implemented using different data structures,
which can make it easier to adapt to changing needs and requirements.
 Information Hiding: ADTs can protect the integrity of data by controlling access and
preventing unauthorized modifications.
 Modularity: ADTs can be combined with other ADTs to form more complex data structures,
which can increase flexibility and modularity in programming.

Disadvantages:
 Overhead: Implementing ADTs can add overhead in terms of memory and processing, which
can affect performance.
 Complexity: ADTs can be complex to implement, especially for large and complex data
structures.
 Learning Curve: Using ADTs requires knowledge of their implementation and usage, which can
take time and effort to learn.
 Limited Flexibility: Some ADTs may be limited in their functionality or may not be suitable for
all types of data structures.
 Cost: Implementing ADTs may require additional resources and investment, which can increase
the cost of development.

1.2 Inheritance
 Inheritance is a fundamental concept in object-oriented programming (OOP), and it allows
you to create a new class that is based on an existing class.
 This existing class is referred as the base class or parent class and the new class is called
the derived class or child class.
 Inheritance facilitates code reusability and the creation of a hierarchical structure for classes.

In C++, there are different types of inheritance:

1. Single Inheritance: In single inheritance, a derived class inherits from a single class.
2. Multiple Inheritance: In multiple inheritance, a derived class can inherit from multiple base
classes.
3. Multilevel Inheritance: In multilevel inheritance, a class inherits from a base class, and then
another class inherits from the derived classs, creating a chain.
4. Hierarchical Inheritance: In hierarchical inheritance, multiple classes inherit from a single base
class.
5. Hybrid Inheritance: Hybrid Inheritance is a combination of two or more types of inheritance.

1.3 Polymorphism

 Polymorphism derived from Greek word poly (many) and morphe (form) means many
forms.
 In C++, Polymorphism allows different classes to be treated uniformly through a common
base class.
 This concept is divided into two types: compile time (static) polymorphism and runtime
(dynamic) polymorphism.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

a) Compile Time Polymorphism (Static Polymorphism)


 Also known as early binding or method overloading.
 Occurs at compile time, when the compiler determines which function or method to
call based on the number and types of arguments.
 Typically achieved through function overloading and operator overloading.

b) Runtime Polymorphism (Dynamic Polymorphism)


 Also known as late binding.
 Occurs at runtime, where the specific function to be executed is determined
dynamically based on the object’s actual type.
 Achieved through virtual functions and inheritance.

1.4 Object Identity

 In object-oriented programming (OOP), objects are the basic entities that actually exists in
the memory.
 Each object is based on a blueprint of attributes and behaviors (variables and functions)
defined as Class.
 The basic purpose of a Class is to identify the common attributes and behaviors and group
them as an entity that can be reused again and again for similar purposes.
 The Objects are such entities that are created based on these classes to follow that purpose.
 All data members and member functions of the class can be accessed with the help of
objects.
 When a class is defined, no memory is allocated, but memory is allocated when it is
instantiated (i.e. an object is created).

Example of Object

For Example, the objects for the class Account are SBI Account, ICICI account, etc.

Identity:

Every object must have a different identity from the other, known as the object’s name. No
two object must have the same name.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

1.5 Object Modeling Technique (OMT)

Object Modeling Technique (OMT) is a real-world-based modeling approach for software


modeling and designing.

 It was developed basically as a method to develop object-oriented systems and to support


object-oriented programming.
 It describes the static structure of the system.
 It is used in many applications like telecommunication, transportation, compilers etc.
 It is also used in many real-world problems.
 OMT is one of the most popular object-oriented development techniques used nowadays.
 OMT was developed by James Rambaugh.

Purpose of Object Modeling Technique

1. To test physical entities before construction of them.


2. To make communication easier with the customers.
3. To present information in an alternative way i.e., visualization.
4. To reduce the complexity of software.
5. To solve the real-world problems.

Object Modeling Technique’s Models

There are three main types of models that have been proposed by OMT:

i) Object Model
 Object Model encompasses the principles of abstraction, encapsulation, modularity,
hierarchy, typing, concurrency and persistence.
 Object Model basically emphasizes on the object and class.
 Main concepts related with Object Model are classes and their association with
attributes.
 Predefined relationships in object model are aggregation and generalization
(multiple inheritance).
ii) Dynamic Model
 Dynamic Model involves states, events and state diagram (transition diagram) on the
model.
 Main concepts related with Dynamic Model are states, transition between states and
events to trigger the transitions.
 Predefined relationships in object model are aggregation (concurrency) and
generalization.
iii) Functional Model
 Functional Model focuses on how data is flowing, where data is stored and different
processes.
 Main concepts involved in Functional Model are data, data flow, data store, process
and actors.
 Functional Model in OMT describes the whole processes and actions with the help
of data flow diagram (DFD).

Phases of Object Modeling Technique

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

OMT has the following phases:

1. Analysis
 This is the first phase of the object modeling technique. This phase involves the preparation
of precise and correct modelling of the real world problems.
 Analysis phase starts with setting a goal i.e. finding the problem statement.
 Problem statement is further divided into above discussed three models i.e. object, dynamic
and functional model.
2. System Design
 This is the second phase of the object modeling technique and it comes after the analysis
phase.
 It determines all system architecture, concurrent tasks and data storage.
 High level architecture of the system is designed during this phase.
3. Object Design
 Object design is the third phase of the object modelling technique and after system design is
over, this phase comes.
 Object design phase is concerned with classification of objects into different classes and
about attributes and necessary operations needed.
 Different issues related with generalization and aggregation are checked.

4. Implementation
 This is the last phase of the object modeling technique. It is all about converting prepared
design into the software.
 Design phase is translated into the Implementation phase.

1.6 Oriented Programming Languages

 Object-oriented programming – As the name suggests uses objects in programming.


 Object-oriented programming aims to implement real-world entities like inheritance, hiding,
polymorphism, etc. in programming.
 The main aim of OOP is to bind together the data and the functions that operate on them so
that no other part of the code can access this data except that function.
There are some basic concepts that act as the building blocks of OOPs i.e.
 Class
 Objects
 Encapsulation
 Data Abstraction
 Polymorphism
 Inheritance
 Dynamic Binding
 Message Passing

Class
 A Class is a user-defined data type that has data members and member functions.
 Data members are the data variables and member functions are the functions used to manipulate
these variables together these data members and member functions define the properties and
behaviour of the objects in a Class.
 For Example: Consider the Class of Cars.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

 There may be many cars with different names and brands but all of them will share
some common properties like all of them will have 4 wheels, Speed Limit, Mileage
range, etc.
 So here, the Car is the class, and wheels, speed limits, and mileage are their properties.
Object
 An Object is an identifiable entity with some characteristics and behavior.
 An Object is an instance of a Class. When a class is defined, no memory is allocated but when
it is instantiated (i.e. an object is created) memory is allocated.
 A class is like a blueprint for an object.
Encapsulation
 In normal terms, Encapsulation is defined as wrapping up data and information under a single
unit.
 In Object-Oriented Programming, Encapsulation is defined as binding together the data and
the functions that manipulate them

Data abstraction
 Data abstraction is one of the most essential and important features of object-oriented
programming in C++.
 Abstraction means displaying only essential information and hiding the details.
 Data abstraction refers to providing only essential information about the data to the outside
world, hiding the background details or implementation.
 Abstraction using Classes:
 We can implement Abstraction in C++ using classes.
 The class helps us to group data members and member functions using available
access specifiers.
 A Class can decide which data member will be visible to the outside world and which
is not.
 Abstraction in Header files:
 One more type of abstraction in C++ can be header files.
 For example, consider the pow() method present in math.h header file.
 Whenever we need to calculate the power of a number, we simply call the function
pow() present in the math.h header file and pass the numbers as arguments without
knowing the underlying algorithm according to which the function is actually
calculating the power of numbers.

List of Object Oriented Programming Languages

 C++
 Java
 C#
 Visual Basic .NET
 JavaScript
 MATLAB
 Object Pascal
 Perl
 PHP
 Python
 Objective-C
 Swift

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

1.7 Object Oriented Databases

 An object-oriented database is a collection of object-oriented programming and relational


database.
 There are various items which are created using object-oriented programming languages like
C++, Java which can be stored in relational databases, but object-oriented databases are well-
suited for those items.
 An object-oriented database is organized around objects rather than actions, and data rather than
logic.
 For example, a multimedia record in a relational database can be a definable data object, as
opposed to an alphanumeric value.

The ODBMS which is an abbreviation for object-oriented database management system is the
data model in which data is stored in form of objects, which are instances of classes. These classes
and objects together make an object-oriented data model.

Components of Object-Oriented Data Model:


The OODBMS is based on TWO major components, namely:
Object structure and Object classes.

1. Object Structure:

 The structure of an object refers to the properties that an object is made up of.
 These properties of an object are referred to as an attribute.
 Thus, an object is a real-world entity with certain attributes that makes up the object
structure.
 Also, an object encapsulates the data code into a single unit which in turn provides data
abstraction by hiding the implementation details from the user.
 The object structure is further composed of three types of components: Messages, Methods,
and Variables. These are explained below.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

1. Messages –
A message provides an interface or acts as a communication medium between an object and the
outside world. A message can be of two types:

 Read-only message: If the invoked method does not change the value of a variable, then the
invoking message is said to be a read-only message.
 Update message: If the invoked method changes the value of a variable, then the invoking
message is said to be an update message.

2. Methods –
When a message is passed then the body of code that is executed is known as a method.
Whenever a method is executed, it returns a value as output. A method can be of two types:

 Read-only method: When the value of a variable is not affected by a method, then it is
known as the read-only method.
 Update-method: When the value of a variable change by a method, then it is known as an
update method.

3. Variables –
It stores the data of an object. The data stored in the variables makes the object distinguishable
from one another.

2. Object Classes:
 An object which is a real-world entity is an instance of a class.
 Hence first we need to define a class and then the objects are made which
differ in the values they store but share the same class definition.
 The objects in turn correspond to various messages and variables stored in
them.

An OODBMS also supports inheritance in an extensive manner as in a database there may be many
classes with similar methods, variables and messages. Thus, the concept of the class hierarchy is
maintained to depict the similarities among various classes.

The concept of encapsulation that is the data or information hiding is also supported by an object -
oriented data model. And this data model also provides the facility of abstract data types apart from
the built-in data types like char, int, float. ADT’s are the user-defined data types that hold the values
within them and can also have methods attached to them.

Features of ODBMS:
 Object-oriented data model: ODBMS uses an object-oriented data model to store and
manage data. This allows developers to work with data in a more natural way, as objects are
similar to the objects in the programming language they are using.
 Complex data types: ODBMS supports complex data types such as arrays, lists, sets, and
graphs, allowing developers to store and manage complex data structures in the database.
 Automatic schema management: ODBMS automatically manages the schema of the
database, as the schema is defined by the classes and objects in the application code. This
eliminates the need for a separate schema definition language and simplifies the development
process.
 High performance: ODBMS can provide high performance, especially for applications that
require complex data access patterns, as objects can be retrieved with a single query.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

 Data integrity: ODBMS provides strong data integrity, as the relationships between objects
are maintained by the database. This ensures that data remains consistent and correct, even in
complex applications.
 Concurrency control: ODBMS provides concurrency control mechanisms that ensure that
multiple users can access and modify the same data without conflicts.
 Scalability: ODBMS can scale horizontally by adding more servers to the database cluster,
allowing it to handle large volumes of data.
 Support for transactions: ODBMS supports transactions, which ensure that multiple
operations on the database are atomic and consistent.

Advantages:
 Supports Complex Data Structures: ODBMS is designed to handle complex data
structures, such as inheritance, polymorphism, and encapsulation. This makes it easier to
work with complex data models in an object-oriented programming environment.
 Improved Performance: ODBMS provides improved performance compared to traditional
relational databases for complex data models. ODBMS can reduce the amount of mapping
and translation required between the programming language and the database, which can
improve performance.
 Reduced Development Time: ODBMS can reduce development time since it eliminates the
need to map objects to tables and allows developers to work directly with objects in the
database.
 Supports Rich Data Types: ODBMS supports rich data types, such as audio, video, images,
and spatial data, which can be challenging to store and retrieve in traditional relational
databases.
 Scalability: ODBMS can scale horizontally and vertically, which means it can handle larger
volumes of data and can support more users.

Disadvantages:
 Limited Adoption: ODBMS is not as widely adopted as traditional relational databases,
which means it may be more challenging to find developers with experience working with
ODBMS.
 Lack of Standardization: ODBMS lacks standardization, which means that different
vendors may implement different features and functionality.
 Cost: ODBMS can be more expensive than traditional relational databases since it requires
specialized software and hardware.
 Integration with Other Systems: ODBMS can be challenging to integrate with other
systems, such as business intelligence tools and reporting software.
 Scalability Challenges: ODBMS may face scalability challenges due to the complexity of
the data models it supports, which can make it challenging to partition data across multiple
nodes.

1.8 Object-Oriented User Interface (OOUI)

 Object-Oriented User Interface (OOUI) is a type of user interface based on an object-


oriented programming metaphor, and describes most modern operating systems ("object-
oriented operating systems") such as MacOS and Windows.
 In an OOUI, the user interacts explicitly with objects that represent entities in the domain that
the application is concerned with.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

 Many vector drawing applications, for example, have an OOUI – the objects being lines,
circles and canvases.
 The user may explicitly select an object, alter its properties (such as size or colour), or invoke
other actions upon it (such as to move, copy, or re-align it).
 Jakob Nielsen defines the OOUI in contrast to function-oriented interfaces: "Object-oriented
interfaces are sometimes described as turning the application inside-out as compared to
function-oriented interfaces.
 The main focus of the interaction changes to become the users' data and other information
objects that are typically represented graphically on the screen as icons or in windows
 Dave Collins defines an OOUI as demonstrating three characteristics:
 Users perceive and act on objects.
 Users can classify objects based on how they behave
 Jef Raskin suggests that the most important characteristic of an OOUI is that it adopts a 'noun-
verb', rather than a 'verb-noun' style of interaction, and that this has several advantages in terms
of usability.

1.9 Object oriented GIS


 GIS (Geographic Information Systems) is the term to designate the systems that work with
spatial and geographical data.
 The real world objects can be represented by using several geometries. With the use of
new geometries, we will have more accurate mechanisms to represent geographic data
 The databases are used normally to store different kind of data. The modeled domain
determines the kind of data that is represented.
 The models used today in a database assure consistensy, security, reduce redundancy and
permit the concurrent access.
 The data stored in a database is different from the data used in a real world. Mechanisms
to store and to retrieve data must be developed.
 The development of the object oriented paradigm programming suggests the use of the
object oriented approach to be considered in a database.
 The object oriented DBMS are created to support CAD applications, multimedia systems
like GIS and to handle voice, video and normal data.
 This paper describes the use and management of geographic objects in a database.
 The DBMS used is the object/relational Informix module.
 A web user interface developed in our research group presents the geographic data.
 The interface manages several GIS aspects like pan, geometric operations (translation,
zoom), scales and coordinates.
 Our work can be a platform to test other aspects like queries, interoperability and sharing
of geographic data.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

Methodology
 We used the OMT methodology because it has the facility to manage objects in the
design step.
 These objects can be used in programming and databases in the object oriented
approach.
 Our goal is to handle geographic objects in three levels: design, programming and
databases.
 At the same time, we keep the advantages offered by the relational model.
Data Model
Two approaches were considered to implement our ideas:
• object oriented database systems
• object/relational database systems
a)Object oriented model
 This approach was inspired from the object oriented programming languages.
 The principal object oriented languages are C++ and Java.
 The object oriented paradigm includes the abstract data type concept.
 The abstract data type declarations are public or private.
 In an object oriented language, the types are implemented by classes.
 The object operations can also be public or private.
 An object is a black box, that is built and modified independently of other objects.
 As the object oriented paradigm is developed new approaches are proposed to
implement the concepts related to the object paradigm.
 Each approach can manage several object concepts in a different way.
b) Object/Relational model
 The more direct way to implement objects in a database and to keep the DBMS
advantages is the Object/Relational model.
 A standard for a multimedia data manager is developed in the context of the SQL
standard.
 To manage geographic data in an object database, the data types are first created.
 A hierarchy is used to represent from the basic data types to the more complex.
 All the data types are then implemented by classes in an object oriented language
programming.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

 In the context of an object database the data that reference the data types is stored in
tables, but the structure of the data is represented by the types.
Geographic objects
 The basic geographic objects that we use are:
 points
 lines
 Polylines
 polygons
 Every kind of object is modeled by an abstract data type.
 We use the vectorial geometry to represent the geographic objects.
 This kind of modeling matches the representation used by the user interface.
 The geometry used in the interface and in the database is based on standard
geographic data.
 The database and the interface shall be used in the context of an interoperability GIS.
OOGIS model
 The principal contribution of our work is the implementation of persistence for
geographic objects.
 The following figure shows the class hierarchy.
 It shows in the first level the View class.
 Each View class is formed by several layers.
 In the second level we then represent the Layer class.
 Each Layer class can be modeled by one and only one data type.
 A brief description of the geographic objects is the following:

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

 Point: It is composed by two coordinates X and Y.


 Line: A line is composed by two points, it means two pairs of X,Y coordinates.
 The aggregation of two points permits the creation of one line.
 From the Line class other more specific classes can be derived.
 These classes manage more attributes, for instance a straight road can be
modeled by a line.
 The road name, the road number and the county are examples of
descriptive data.
 Polyline: A polyline is composed by two or more lines.
 A polyline is an aggregation of lines. Like a line, a polyline can derive
more specific classes.
 The river class is an example of an object that is a polyline.
 Descriptive attributes are used to model additional information.
 Polygon: A polygon is similar to a polyline but it is closed.
 The basic geographic data polygone doesn't give a description for a map.
 More specific types (derived from polygon), like lakes, states or other
object that can be represented by a polygon, will give descriptive map
information.
 Layer: A layer is composed by the aggregation of two or more objects of the same
type. For instance, the lake layer, the road layer and the county layer.
 View: A view is composed by the aggregation of two or more layers.
 The view class manages the activation of layers for edition.
 In this case it is possible to add new geographic objects.
 In our application, this class manages a method to do the intersection of
two classes.
 The next section describes how all the objects are organized in the
database.
Database construction
 The database is composed by two parts, the data type description and the tables.
 The tables make reference to data types to describe their structure.
 The data type description shows their attributes.
 The objects are stored in the tables, but they make reference to the corresponding data
types for their description.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

Prototype
 Our model was tested by using the Java object oriented language program and IUS
DBMS on Solaris.
 Our application has the following modules:
• the operations manager
• the database server
• the interface manager
• the modeling manager
 Our prototype was tested with data from the Universidad de las Americas, campus.
 The prototype architecture is shown in the following figure.
 An example of the creation of tables and the data insertion is as follows:

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

The spatial data are stored in the database in three steps:


1. The layer names are associated to one project name. The table that implements the view
type store the layer and project name association. This operation is done by the save
method which belongs to the view class.
2. The view class save method calls the layer class save method. This method first stores
in the layer table (which implements the layer class) the type and the name of the layer.
3. The same method (layer class save method) creates the table to store the layer attributes
like color, name and description data type. This table implements the different geographic
object data types (point, line, polyline, polygon). For each layer the method generates one
table.

1.10 Object Oriented Analysis

Object-Oriented Analysis (OOA) is the first technical activity performed as part of object-
oriented software engineering. OOA introduces new concepts to investigate a problem. It is
based on a set of basic principles, which are as follows:

 The information domain is modeled:


 Lets say you’re building a game. OOA helps you figure out all the things you need to
know about the game world – the characters, their features, and how they interact. It’s
like making a map of everything important.

 Behavior is represented:
 OOA also helps you understand what your game characters will do. If a character
jumps when you press a button, OOA helps describe that action. It’s like writing
down a script for each character.

 The function is described:


 Every program has specific tasks or jobs it needs to do. OOA helps you list and
describe these jobs. In our game, it could be tasks like moving characters or keeping
score. It’s like making a to-do list for your software.

 Data, functional, and behavioral models are divided to uncover greater detail:
 OOA is smart about breaking things into different parts. It splits the job into three
categories: things your game knows (like scores), things your game does (like
jumping), and how things in your game behave (like characters moving around). This
makes it easier to understand.

 Starting Simple, Getting Detailed:


 OOA knows that at first, you just want to understand the big picture. So, it starts with
a simple version of your game or program. Later on, you add more details to make it
work perfectly. It’s like sketching a quick drawing before adding all the colors and
details.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

Advantages / Disadvantages of Object Oriented Analysis


Advantages Disadvantages

Functionality is restricted within objects.


Focuses on data rather than the procedures This may pose a problem for systems
as in Structured Analysis. which are intrinsically procedural or
computational in nature.

The principles of encapsulation and data


hiding help the developer to develop It cannot identify which objects would
systems that cannot be tampered by other generate an optimal system design.
parts of the system.

The principles of encapsulation and data


The object-oriented models do not easily
hiding help the developer to develop
show the communications between the
systems that cannot be tampered by other
objects in the system.
parts of the system.

It allows effective management of software All the interfaces between the objects
complexity by the virtue of modularity. cannot be represented in a single diagram.

1.10 Object-oriented design


 In the object-oriented software development process, the analysis model, which is initially
formed through object-oriented analysis (OOA), undergoes a transformation during object-
oriented design (OOD).
 This evolution is crucial because it shapes the analysis model into a detailed design model,
essentially serving as a blueprint for constructing the software.
 The outcome of object-oriented design, or OOD, manifests in a design model characterized
by multiple levels of modularity. This modularity is expressed in two key ways:
 Subsystem Partitioning:
 At a higher level, major components of the system are organized into subsystems.
 This practice is similar to creating modules at the system level, providing a structured
and organized approach to managing the complexity of the software.
 Object Encapsulation:
 A more granular form of modularity is achieved through the encapsulation of data
manipulation operations into objects. ” It’s like putting specific tasks (or operations)
and the data they need into little boxes called “objects.”
 Each object does its job neatly and keeps things organized. So, if our game has a
character jumping, we put all the jumping stuff neatly inside an object.
 It’s like having a box for each task, making everything easier to handle and
understand.
Furthermore, as part of the object-oriented design process, it is essential to define specific aspects:

 Data Organization of Attributes:


 OOD involves specifying how data attributes are organized within the objects. This
includes determining the types of data each object will hold and how they relate to
one another, ensuring a coherent and efficient data structure.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

 Procedural Description of Operations:


 OOD requires a procedural description for each operation that an object can perform.
This involves detailing the steps or processes involved in carrying out specific tasks,
ensuring clarity and precision in the implementation of functionality.
Below diagram shows a design pyramid for object-oriented systems. It is having the following four
layers.

1. The Subsystem Layer: It represents the subsystem that enables software to achieve user
requirements and implement technical frameworks that meet user needs.
2. The Class and Object Layer: It represents the class hierarchies that enable the system to
develop using generalization and specialization. This layer also represents each object.
3. The Message Layer: This layer deals with how objects interact with each other. It includes
messages sent between objects, method calls, and the flow of control within the system.
4. The Responsibilities Layer: It focuses on the responsibilities of individual objects. This
includes defining the behaviour of each class, specifying what each object is responsible for, and
how it responds to messages.

Benefits of Object-Oriented Analysis and Design(OOAD)


 Improved modularity: OOAD encourages the creation of small, reusable objects that can be
combined to create more complex systems, improving the modularity and maintainability of the
software.
 Better abstraction: OOAD provides a high-level, abstract representation of a software system,
making it easier to understand and maintain.
 Improved reuse: OOAD encourages the reuse of objects and object-oriented design patterns,
reducing the amount of code that needs to be written and improving the quality and consistency
of the software.
 Improved communication: OOAD provides a common vocabulary and methodology for
software developers, improving communication and collaboration within teams.
 Reusability: OOAD emphasizes the use of reusable components and design patterns, which can
save time and effort in software development by reducing the need to create new code from
scratch.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

 Scalability: OOAD can help developers design software systems that are scalable and can
handle changes in user demand and business requirements over time.
 Maintainability: OOAD emphasizes modular design and can help developers create software
systems that are easier to maintain and update over time.
 Flexibility: OOAD can help developers design software systems that are flexible and can adapt
to changing business requirements over time.
 Improved software quality: OOAD emphasizes the use of encapsulation, inheritance, and
polymorphism, which can lead to software systems that are more reliable, secure, and efficient.

Challenges of Object-Oriented Analysis and Design(OOAD)


 Complexity: OOAD can add complexity to a software system, as objects and their relationships
must be carefully modeled and managed.
 Overhead: OOAD can result in additional overhead, as objects must be instantiated, managed,
and interacted with, which can slow down the performance of the software.
 Steep learning curve: OOAD can have a steep learning curve for new software developers, as it
requires a strong understanding of OOP concepts and techniques.
 Complexity: OOAD can be complex and may require significant expertise to implement
effectively. It may be difficult for novice developers to understand and apply OOAD principles.
 Time-consuming: OOAD can be a time-consuming process that involves significant upfront
planning and documentation. This can lead to longer development times and higher costs.
 Rigidity: Once a software system has been designed using OOAD, it can be difficult to make
changes without significant time and expense. This can be a disadvantage in rapidly changing
environments where new technologies or business requirements may require frequent changes to
the system.
 Cost: OOAD can be more expensive than other software engineering methodologies due to the
upfront planning and documentation required.

Real world applications of Object-Oriented Analysis and Design(OOAD)


Object-Oriented Analysis and Design (OOAD) has been widely applied across various industries to
improve software development processes, enhance maintainability, and promote code reusability.

Here are some real-world applications of OOAD:

1. Financial Systems:
 Banking Software
2. Healthcare Systems:
 Electronic Health Record (EHR) Systems
3. Aerospace and Defense:
 Flight Control Systems
4. Telecommunications:
 Telecom Billing Systems:
5. E-commerce:
 Online Shopping Platforms
.
Some important points to know about OOP:

• OOP treats data as a critical element.


• Emphasis is on data rather than procedure.
• Decomposition of the problem into simpler modules.
• Doesn’t allow data to freely flow in the entire system, ie localized control flow.
• Data is protected from external functions.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP


22CST201- OBJECT ORIENTED PROGRAMMING

Advantages of OOPs –

• It models the real world very well.


• With OOP, programs are easy to understand and maintain.
• OOP offers code reusability. Already created classes can be reused without having to write
them again.
• OOP facilitates the quick development of programs where parallel development of classes is
possible.
• With OOP, programs are easier to test, manage and debug.

Disadvantages of OOPs –

• With OOP, classes sometimes tend to be over-generalized.


• The relations among classes become superficial at times.
• The OOP design is tricky and requires appropriate knowledge. Also, one needs to do proper
planning and design for OOP programming.
• To program with OOP, the programmer needs proper skills such as design, programming, and
thinking in terms of objects and classes, etc.

OOP 1.1 JNNIE/CSE/R-22/I YR/OOP

You might also like