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

Unit I (Introduction)

Object-oriented programming uses objects, not algorithms, as its fundamental building blocks. Classes define common structure and behavior among objects. Key concepts include encapsulation, which binds data to the methods that operate on it; inheritance, which enables code reuse and hierarchical relationships among classes; polymorphism, which allows the same message to be interpreted differently; and abstraction, which separates interface from implementation. Well-designed software uses modular components with loosely coupled interfaces.

Uploaded by

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

Unit I (Introduction)

Object-oriented programming uses objects, not algorithms, as its fundamental building blocks. Classes define common structure and behavior among objects. Key concepts include encapsulation, which binds data to the methods that operate on it; inheritance, which enables code reuse and hierarchical relationships among classes; polymorphism, which allows the same message to be interpreted differently; and abstraction, which separates interface from implementation. Well-designed software uses modular components with loosely coupled interfaces.

Uploaded by

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

Unit I (Introduction)

Object
From the perspective of human cognition, an object is any of the following:

A tangible and/or visible thing


Something that may be comprehended intellectually
Something toward which thought or action is directed

Object is something that exists in time and space.


According to Smith and Tockey, an object represents an individual,
identifiable item, unit, or entity, either real or abstract, with a well-defined
role in the problem domain".
An object is an entity that has state, behavior, and identity. The structure
and behavior of similar objects are defined in their common class. The terms
instance and object are interchangeable.
Object-oriented

analysis

is

method

of

analysis

that

examines

requirements from the perspective of the classes and objects found in the
vocabulary of the problem domain.
OOA is a collection of like-minded requirements modeling and analysis
techniques for software systems.
Object-oriented design is the process of planning a system of interacting
objects for the purpose of solving a software problem.
Object-oriented design is a method of design encompassing the process
of objects oriented decomposition and a notation for depicting both logical
and physical as well as static and dynamic models of the system under
design.
Page 1 of 7

There are two important parts to this definition: object-oriented design


(1) leads to an object-oriented decomposition and
(2) Uses different notations to express different models of the logical (class
and object structure) and physical (module and process architecture)
design of a system, in addition to the static and dynamic aspects of the
system.
By applying object-oriented design, we create software that is resilient to
change and written with economy of expression. We achieve a greater level
of confidence in the correctness of our software through an intelligent
separation of its state space. Ultimately, we reduce the risks inherent in
developing complex software systems.
Object-oriented design uses a notation and process for constructing
complex software systems and offers a rich set of models with which we may
reason about different aspects of the system under consideration.
Object-oriented analysis and design is the method that leads us to object
oriented decomposition.
Object Oriented Programming (OOP)
Object-oriented programming is a method of implementation in which
programs are organized as cooperative collections of objects, each of which
represents an instance of some class, and whose classes are all members of
a hierarchy of classes united via inheritance relationships.
There are three important parts to this definition:
(1)Object-oriented programming uses objects, not algorithms, as its
fundamental logical building;
Page 2 of 7

(2)each object is an instance of some class; and


(3)Classes may be related to one another via inheritance relationships.
[A] Language is object-oriented if and only if it satisfies the following
requirements:

It supports objects that are data abstractions with an interface of named

operations and a hidden local state.


Objects have an associated type [class].
Types [classes] may inherit attributes from super types [super classes].

Class
A class is a set of objects that share a common structure, common behavior,
and common semantics.
A single object is simply an instance of a class.
What isnt a class? An object is not a class. Objects that share no common
structure and behavior cannot be grouped in a class because, by definition,
they are unrelated except by their general nature as objects.
We can further divide the interface of a class into four parts:
1. Public: a declaration that is accessible to all clients
2. Protected: a declaration that is accessible only to the class itself and
its subclasses
3. Private: a declaration that is accessible only to the class itself
4. Package: a declaration that is accessible only by classes in the same
package
Abstraction
The process of separating the how from the whathow an operation is
performed inside a class, as opposed to whats visible to the class useris
called

abstraction.

Abstraction

is

an

important

aspect

of

software

engineering. By abstracting class functionality we make it easier to design a


Page 3 of 7

program because we dont need to think about implementation details at too


early a stage in the design process.
An abstraction is the essence or set of important characteristics of some
entity. The office of president, for example, is an abstraction, considered
apart from the individual who happens to occupy that office. The powers and
responsibilities of the office remain the same, while individual office-holders
come and go.

Encapsulation
Encapsulation is an Object Oriented Programming concept that binds
together the data and functions that manipulate the data, and that keeps
both safe from outside interference and misuse. Data encapsulation led to
the important OOP concept of data hiding.
Data encapsulation is a mechanism of bundling the data, and the
functions that use them and data abstraction is a mechanism of exposing
only the interfaces and hiding the implementation details from the user.
C++ supports the properties of encapsulation and data hiding through the
creation of user-defined types, called classes.

Polymorphism
The ability to use an operator or function in different ways in other words
giving different meaning or functions to the operators or functions is called
polymorphism. Poly refers to many. That is a single function or an operator
functioning in many ways different upon the usage is called polymorphism.
Page 4 of 7

Inheritance
One of the most useful aspects of object-oriented programming is code
reusability. As the name suggests Inheritance is the process of forming a
new class from an existing class that is from the existing class called as
base class, new class is formed called as derived class.
This is a very important concept of object-oriented programming since this
feature helps to reduce the code size.

Modularity
Modularity is the property of a system that has been decomposed into a set
of cohesive and loosely coupled modules.
Modularity is designing a system that is divided into a set of functional units
(named modules) that can be composed into a larger application. A module
represents a set of related concerns. It can include a collection of related
components, such as features, views, or business logic, and pieces of
infrastructure, such as services for logging or authenticating users. Modules
are independent of one another but can communicate with each other in a
loosely coupled fashion.

Hierarchy
Hierarchy is a ranking or ordering of abstractions.

Page 5 of 7

The two most important hierarchies in a complex system are its class
structure (the is a hierarchy) and its object structure (the part of
hierarchy).
A hierarchy is an organizational structure in which items are ranked
according to levels of importance. Most governments, corporations and
organized religions are hierarchical.

Interface
An interface is a programming structure/syntax that allows the computer to
enforce certain properties on an object (class). For example, say we have a
car class and a scooter class and a truck class. Each of these three classes
should have a start_engine() action. How the "engine is started" for each
vehicle is left to each particular class, but the fact that they must have a
start_engine action is the domain of the interface.
In summary the Interface separates the implementation and defines the
structure, and this concept is very useful in cases where you need the
implementation to be interchangeable. Apart from that an interface is very
useful when the implementation changes frequently. Some say you should
define all classes in terms of interfaces, but I think recommendation seems
a bit extreme.
Interface can be used to define a generic template and then one or more
abstract

classes

to

define

partial

implementations

of

the

interface.

Interfaces just specify the method declaration (implicitly public and

Page 6 of 7

abstract) and can contain properties (which are also implicitly public and
abstract).

Implementation
In order to implement objects, we will abandon dot notation (which does
require built-in language support), but create dispatch dictionaries that
behave in much the same way as the elements of the built-in object
system. We have already seen how to implement message-passing behavior
through dispatch dictionaries. To implement an object system in full, we
send messages between instances, classes, and base classes, all of which
are dictionaries that contain attributes.

Page 7 of 7

You might also like