Fundamental Concepts Used in OOPs
Ø Object :
These are basic runtime entities in an object oriented system.An object is an instance of class.A class must be instantiated
to an object before it is used.When a program is executed,objects interact with eachother by sending messages.Thus the problem is
analyzed in terms of objects and communication can be done.One of the advantage is they enable programmers to create module that
need not to be changed when a new object is added.
Ø Class :
Class is a collection of Objects.Once a class is defined we can add any number of objects which belongs to that class.A class
is a prototype which defines methods and variables common to all objects.
Ø Instance:
The real object created at runtime is called instance.
Ø Method:
It describes the ability of an object.
Ø Message Passing:
The process in which an object sends data to another object and ask the other object to invoke a method.This corresponds to method of calling.
Ø Abstraction:
One of the principle of oops which is used to display necessary and essential features of the object and encapsulate the unnecessary
things.Hiding can be achieved by using private acess modifiers. 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.
Ø Encapsulation:
It is the process of wrapping of data and keep safe from outside interference and misuse.Storing data and functions in a single unit is
called Encapsulation.The functions which are stored in the class can access it and the data from outside cannot access it.
Ø Inheritance:
It is the process of forming a new class from an existing class or base class. In object-oriented programming, inheritance enables new
objects to take on the properties of existing objects. A class that is used as the basis for inheritance is called a superclass or base
class. A class that inherits from a superclass is called a subclass or derived class. The terms parent class and child class are also
acceptable terms to use respectively. A child inherits visible properties and methods from its parent while adding additional properties
and methods of its own. It is classifieds into different types, they are
Ø Single level inheritance
Ø Multi-level inheritance
Ø Hybrid inheritance
Ø Hierarchial inheritance
Ø Polymorphism:
The ability to take more than one form. Polymorphism is only concerned with the application of specific implementations
to an interface or a more generic base class.In general, polymorphism means "one interface, multiple methods", This
means that it is possible to design a generic interface to a group of related activities.This helps to reduce Complexity.
Ø Generalization:
It describes a relationship which represents a hierarchy between classes of objects. Example: Vegetable is a generalization of
potato,tomato etc.
Ø Specialization:
It means an object can inherit the common state and behaviour of a generic object.specialization means subclass.Animal belongs to
generalization and pet is the specialization.
Advantages Of Oops:
Improved software development productivity :
Oops is modular and extensible. Objects can also be reused within an across applications. Because of these three factors modularity, extensibility, and reusability.
Improved software maintainability :
It is easier to maintain and modify existing code as new objects can be created with small differences to existing ones since the design is modular.
Reusability:
Objectoriented programming languages come with rich libraries of objects,and code developed during projects is also reusable in future projects.
LowCost :
The reuse of software lowers the cost of development.
Disadvantages Of Oops:
Ø It is complex to create programs based on interaction of objects.
Ø Large program size-more lines of code than procedural programs.
Ø Object :
These are basic runtime entities in an object oriented system.An object is an instance of class.A class must be instantiated
to an object before it is used.When a program is executed,objects interact with eachother by sending messages.Thus the problem is
analyzed in terms of objects and communication can be done.One of the advantage is they enable programmers to create module that
need not to be changed when a new object is added.
Ø Class :
Class is a collection of Objects.Once a class is defined we can add any number of objects which belongs to that class.A class
is a prototype which defines methods and variables common to all objects.
Ø Instance:
The real object created at runtime is called instance.
Ø Method:
It describes the ability of an object.
Ø Message Passing:
The process in which an object sends data to another object and ask the other object to invoke a method.This corresponds to method of calling.
Ø Abstraction:
One of the principle of oops which is used to display necessary and essential features of the object and encapsulate the unnecessary
things.Hiding can be achieved by using private acess modifiers. 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.
Ø Encapsulation:
It is the process of wrapping of data and keep safe from outside interference and misuse.Storing data and functions in a single unit is
called Encapsulation.The functions which are stored in the class can access it and the data from outside cannot access it.
Ø Inheritance:
It is the process of forming a new class from an existing class or base class. In object-oriented programming, inheritance enables new
objects to take on the properties of existing objects. A class that is used as the basis for inheritance is called a superclass or base
class. A class that inherits from a superclass is called a subclass or derived class. The terms parent class and child class are also
acceptable terms to use respectively. A child inherits visible properties and methods from its parent while adding additional properties
and methods of its own. It is classifieds into different types, they are
Ø Single level inheritance
Ø Multi-level inheritance
Ø Hybrid inheritance
Ø Hierarchial inheritance
Ø Polymorphism:
The ability to take more than one form. Polymorphism is only concerned with the application of specific implementations
to an interface or a more generic base class.In general, polymorphism means "one interface, multiple methods", This
means that it is possible to design a generic interface to a group of related activities.This helps to reduce Complexity.
Ø Generalization:
It describes a relationship which represents a hierarchy between classes of objects. Example: Vegetable is a generalization of
potato,tomato etc.
Ø Specialization:
It means an object can inherit the common state and behaviour of a generic object.specialization means subclass.Animal belongs to
generalization and pet is the specialization.
Advantages Of Oops:
Improved software development productivity :
Oops is modular and extensible. Objects can also be reused within an across applications. Because of these three factors modularity, extensibility, and reusability.
Improved software maintainability :
It is easier to maintain and modify existing code as new objects can be created with small differences to existing ones since the design is modular.
Reusability:
Objectoriented programming languages come with rich libraries of objects,and code developed during projects is also reusable in future projects.
LowCost :
The reuse of software lowers the cost of development.
Disadvantages Of Oops:
Ø It is complex to create programs based on interaction of objects.
Ø Large program size-more lines of code than procedural programs.