Basic Concepts of OOps Assig + Notes
Basic Concepts of OOps Assig + Notes
Chapter 5 [2+5=7]
----------------------------------------------------------------------------------------------------------------------
Objects:
• Objects are basic building blocks for designing programs. An object may
represent a person, place or a table of data.
• Every object has to be given the unique name.
• Objects are saved in memory and associated with address.
• During execution of program objects will communicate with each other by sending
message to one another.
Classes:
• A class is a way of grouping objects having similar characteristics.
• Once a class is defined any number of objects can be created.
• Classes are user defined data types where it can hold both data and functions.
Data abstraction:
• Abstraction refers to the process of representing essential features without
including background details.
• Data abstraction permits user to use the objects without knowing its internal
working.
Data encapsulation:
• Data encapsulation combines data and functions into a single unit called class.
• It will prevent direct access of data.
• Data can be accessed only using member function of the class.
• It enables information hiding or data hiding.
Inheritance:
Overloading:
• Overloading allows objects to have different meaning on different context.
• Types of overloading:
➢ Operator overloading: When an existing operator operates on new data
type it is called operator overloading.
➢ Function overloading: When two or more function have same name but
differ in the number of arguments then its function overloading.
Polymorphism:
• It’s a feature where a function can take multiple forms based on the type of
arguments, number of arguments and data type of return value.
• The ability of operator and function to take multiple forms is known as
polymorphism.
Dynamic binding:
• Binding is the process of connecting one program to another
• Dynamic binding means code of procedure call is known at the time of
program execution.
Message passing:
• Processing of objects is done by passing messages to object.
• A message for an object is request for execution this request will involve a
function in the receiving object which generates desired result.
• Message passing involves specifying name of object, name of function and
information to be sent.
Advantages of OOPs:
• Modularity based on class and object principle is followed.
• Code reusability to avoid code duplication.
• Encapsulation provides security of data from being used by non member
function of class.
• Easier to develop complex software because inheritance helps to overcome code
complexity.
• Object specification and implementation are separated by concept abstraction.
• Development time of software is reduced because creation and implementation
is easy.
Limitations of OOPs:
• No set standards.
• Flow diagram of OOP is complex.
• Converting real world problem to OOP is difficult.
• Classes are more generalized.
Applications of OOP:
• Computer graphic applications.
• CAD/CAM soft wares
• Object oriented database
• Windows development.
• Real time systems.
• Simulation or modeling
• Artificial intelligence and expert systems
Assignment