OOP Implementation

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 43

• Structured Programming

– Large programming project


– Emphasis on algorithm rather than data
– Programs are divided into individual procedures
that perform discrete tasks
– Procedures are independent of each other as far
as possible
– Procedures have their own local data and
processing logic
– Parameter passing facility between the
procedures for information communication
– Introduced the concept of user defined data types
– Support modular programming
– Projects can be broken up into modules and
programmed independently
– Scope of the data items is controlled across
modules
– Maintenance of a large software system is tedious
and costly
• Object oriented programming is a method of
implementation in which programs are organized as co-
operative collection of objects, each of which represents an
instance of some class and whose classes are all members
of hierarchy of classes united through the property called
inheritance.
• Object Based Programming Languages
– Encapsulation
– Object Identity
• Example
– Ada
• Object Oriented Programming Languages
– Object Based features
– Inheritance
– Polymorphism
• Example
– C++, Java, Smalltalk, Eiffel
• Developed by Bjarne Stroustrup at AT&T Bell
Laboratories in USA
• Incremented version of C
• Superset of C
• Object Oriented Programming
– OOP treats data as a critical element
– Emphasis on data rather than algorithm
– Decompose the problem into number of entities
namely objects
– Doesn’t allow data to flow freely around the
system
– Data is hidden and cannot be accessed by external
function
– Data and the functions that operate on the data
are tied together in the data structure
– Object may communicate with each other through
functions
– New data and functions can be added whenever
necessary
– Follows bottom up approach
• Object
• Classes
• Data abstraction
• Encapsulation
• Inheritance
• Polymorphism
• Dynamic Binding
• Message Passing
• Object
– Objects are the basic run time entities in an object
oriented system
– Object is a instance of class
– We can say that objects are variables of the type
class
– Objects can be student, employee, car, book, etc
Basic Concepts of Object Oriented
Programming
Object representation
• Classes
– A class is a user defined data type.
– A class is a collection of data member and member
functions.
– Variable declared in class are called data member and
functions declared in class are known as member
functions.
– A class is an abstraction of the real world entities with
similar properties.
– A class identifies a set of similar properties.
– A class is an implementation of abstract data type.
• Data Abstraction

– Abstraction refers to the act of representing


essential features without including the
background details or explanations.

– Classes use the concept of abstraction and are


defined as a list of abstract attributes such as
size, weight, cost etc.
• Encapsulation

– The wrapping of data and functions into a single


unit is known as encapsulation.

– The data is not accessible to the outside


world, and only those functions which are
wrapped in the class can access it.
• Inheritance
– Inheritance is the process by which objects of one
class acquire the properties of objects of another
class.
– Create a new class from existing class.
– The main benefits of the Inheritance is code
reusability.
• Add additional features to an existing class without
modifying it.
• Polymorphism
– Polymorphism is a Greek term.
– It means the ability to take more than one form.
– An operation may exhibit different behaviors in
different instances.
– The behavior depends upon the type of data used
in the operation.
• For adding two number operation will generate sum of
two number.
• For adding two string operation will concate two string.
• Dynamic Binding(Late Binding)

– Binding refers to the linking of a procedure call to


the code to be executed in response to call.

• Dynamic binding means that the code associated with a


given function call is not known until the time of the call at
run time.
• Message Passing
– Objects communicate with one another by
sending and receiving information.
Student.setData(Id, Name);

Object
Message Information
• Through inheritance, redundant code is
eliminated and extend the use of existing classes.
• One can build programs from the standard
working modules that communicate with one
another.
– No need to write from scratch.
– Save the development time and increase the
productivity.
• The principal of data hiding helps the
programmer to build the secure program.
• The data centered design approach enable
programmer to get details of a model in
implementable form.
• Possible to map objects in the problem domain to
those in the program.
• It is easy to partition the work in project based on
objects.
• Easily upgradable from small system to large
system.
• Software complexity can be easily managed.
What are the applications of OOP?
What are the application of C++?
Applications of OOP
1. Client-Server Systems
Object-oriented client-server systems provide
the IT infrastructure, creating Object-Oriented
Client-Server Internet (OCSI) applications.
Here, infrastructure refers to operating systems,
networks, and hardware. OSCI consist of three
major technologies:
•The Client Server
•Object-Oriented Programming
•The Internet
Applications of OOP
2. Object-Oriented Databases
They are also called Object Database Management
Systems (ODBMS). These databases store objects
instead of data, such as real numbers and integers.
Objects consist of the following:
Attributes: Attributes are data that define the traits of
an object. This data can be as simple as integers and
real numbers. It can also be a reference to a complex
object.
Methods: They define the behavior and are also called
functions or procedures.
Applications of OOP
3. Object-Oriented Databases
These databases try to maintain a direct correspondence
between the real-world and database objects in order to
let the object retain its identity and integrity. They can
then be identified and operated upon.
Applications of OOP
4. Real-Time System Design
Real-time systems inherent complexities that make it
difficult to build them. Object-oriented techniques make it
easier to handle those complexities. These techniques
present ways of dealing with these complexities by
providing an integrated framework, which includes
schedulability analysis and behavioral specifications.
Applications of OOP
5. Simulation and Modeling System
It’s difficult to model complex systems due to the varying
specification of variables. These are prevalent in
medicine and in other areas of natural science, such as
ecology, zoology, and agronomic systems. Simulating
complex systems requires modeling and understanding
interactions explicitly. Object-oriented programming
provides an alternative approach for simplifying these
complex modeling systems.
Applications of OOP
6. Hypertext and Hypermedia
OOP also helps in laying out a framework for hypertext.
Basically, hypertext is similar to regular text, as it can be
stored, searched, and edited easily. The only difference
is that hypertext is text with pointers to other text as well.
Hypermedia, on the other hand, is a superset of
hypertext. Documents having hypermedia not only
contain links to other pieces of text and information but
also to numerous other forms of media, ranging from
images to sound.
Applications of OOP
6. Hypertext and Hypermedia
OOP also helps in laying out a framework for hypertext.
Basically, hypertext is similar to regular text, as it can be
stored, searched, and edited easily. The only difference
is that hypertext is text with pointers to other text as well.
Hypermedia, on the other hand, is a superset of
hypertext. Documents having hypermedia not only
contain links to other pieces of text and information but
also to numerous other forms of media, ranging from
images to sound.
Applications of OOP
7. Neural Networking and Parallel Programming
It addresses the problem of prediction and
approximation of complex time-varying systems. Firstly,
the entire time-varying process is split into several time
intervals or slots. Then, neural networks are developed
in a particular time interval to disperse the load of
various networks. OOP simplifies the entire process by
simplifying the approximation and prediction ability of
networks.
Applications of OOP
8. Office Automation Systems
These include formal as well as informal electronic
systems primarily concerned with information sharing
and communication to and from people inside and
outside the organization. Some examples are:
•Email
•Word processing
•Web calendars
•Desktop publishing
Applications of OOP
9. CIM/CAD/CAM Systems
OOP can also be used in manufacturing and design
applications, as it allows people to reduce the effort
involved. For instance, it can be used while
designing blueprints and flowcharts. OOP makes it
possible for the designers and engineers to produce
these flowcharts and blueprints accurately.
Applications of OOP
10. AI Expert Systems
These are computer applications that are developed to
solve complex problems pertaining to a specific domain,
which is at a level far beyond the reach of a human
brain.
It has the following characteristics:
•Reliable
•Highly responsive
•Understandable
•High-performance
What are the applications of OOP?
What are the application of C++?
Uses of C++ (With Real-World
Applications)
Almost all the programs and systems that
you use or a part of their codebase is
written either in C or C++. Be it Windows,
a web browser, your favorite game, or a
video editing software, the uses of C++
can be found in almost all applications
today. Here are some interesting areas
where C++ is popularly used.
1. Operating Systems

C++ is a fast and strongly-typed


programming language which makes it an
ideal choice for developing operating
systems. Mac OS X has large amounts
written in C++. Most of the software from
Microsoft like Windows, Microsoft Office,
IDE Visual Studio, and Internet Explorer
are also written in C++.
2. Games

Since C++ is closer to hardware, game


development companies use it as their
primary choice to develop gaming
systems. It can easily manipulate
resources and can override the
complexities of 3D games and
multiplayer networking.
3. GUI Based Applications
C++ is also used to develop GUI-based and
desktop applications. Most of the applications
from Adobe such as Photoshop, Illustrator, etc.
are developed using C++.

4. Web Browsers
Web browsers need to be fast in execution as
people do not like to wait for their web pages
to be loaded. This is why most browsers are
developed in C++ for rendering purposes.
Mozilla Firefox is completely developed from
C++. Google applications like Chrome and
Google File System are partly written in C++.
5. Embedded Systems
Various embedded systems that require the
program to be closer to hardware such as
smartwatches, medical equipment systems, etc.,
are developed in C++. It can provide a lot of
low-level function calls, unlike other high-level
programming languages.

6. Banking Applications
Since banking applications require concurrency,
multi-threading, concurrency, and high
performance, C++ is the default choice of
programming language. Infosys Finacle is a
popular banking application developed using
C++.
7. Compilers
The compilers of many programming languages
are developed in C and C++. This is because
they are relatively lower-level when compared to
other higher-level languages and are closer to
the hardware.

8. Database Management Software


C++ is also used to write database
management software. The world’s most popular
open-source database, MySQL, is written in
C++.
9. Cloud/Distributed Systems

Cloud storage systems that are used extensively


need to work closer to the hardware. This makes
C++ the default choice for implementing cloud
storage systems. These systems also require
multithreading support to build concurrent
applications that support load tolerance, which
C++ provides. Bloomberg is a distributed RDBMS
application that is primarily written in C, but its
development environment and set of libraries are
all written with C++.
10. Libraries

Libraries require very high-level


mathematical computations, performance,
and speed. Hence C++ is the core
programming language used by most
libraries. Tensorflow, one of the most
popularly used Machine Learning libraries
uses C++ as its backend programming
language.
11. Switches
Because C++ is one of the fastest
programming languages, it is widely used for
programming routers, telephone switches, and
space probes.

12. Advanced Computation and Graphics


Just like web browsers, all graphics
applications require fast rendering. High-end
graphical processing, computer vision, or
digital image processing software all use C++
as the backend programming language.
End of session 1

You might also like