Lets Start With C++
- C++ is an extension to C Programming Language.
- It was developed at AT & T Bell Laboratories in the early in 1970s by Bjarne Stroustrup.
- Its name was C with Classes ,but later on in 1983 it was renamed as C++.
- C++ is an Object Oriented Programing(OOP) Language.
- Object Oriented Programming(OOP) is the term used to describe a programming approach based on Objects and Classes.
- An object oriented programming language generally support 5 main features
- Objects
- Classes
- Classification
- Polymorphism
- Inheritance
Paradigm Of Programming Language
The term Paradigm describes a set of techniques ,methods ,theories and standards that together representing a way of thinking for problem solving.
Structured Programming Paradigm #Structured Programming basically focus on these 3 approaches
*Logical Structure
*Divide And Conquer Approach
*Top Down Approach
Advantages of Structured Programming (C++ Programming)
- Complexity can be reduced using the concepts of divide and conquer approach.
- Logical Structure ensure clear flow of control.
- Modules can be reused many times ,it saves time ,reduces complexity ,and increases reliability.
- Lack of encapsulation
- Same code repetition
- Lack of information hiding
- Not much reusability of code
Everything is focused on Objects.
Program consist of two things:
- First, a set of objects.
- Second, the way they interact with each other.
Structured Vs Oriented System
- Structured Programming is a subset of Object Oriented Programming.
- In Structure Programming focus of a program is on manipulation of data but in OOP the focus of the program is on both Data and Manipulation.
- In Structured Programming the data is in the form of variables but in OOP the data is hidden within the Objects.
1.Objects
*An Object is an instance of a Class.
*Objects are the Real World Models.
*They may represent a person, a place, a bank account, a table of data or any item that the program has to handle.
*They contain there own data and behaviour.
In the above picture Class is a Vehicle and its Objects are car, bus and truck.
2.Class
*A Class is a collection of objects of similar type.
*Once a Class has been defined, we can create any number of objects belonging to that Class.
*Object are the variables of the type class.
3.Abstraction
Abstraction is a technique which allows the hiding or elimination of irrelevant data and focusing on essential data.
4.Encapsulation
- The wrapping up of data and functions into a single unit(CLASS) is known as Encapsulation
- Encapsulation refers to how the implementation details of particular class are hidden from all the Objects outside the class.
- The Classes and hence their corresponding Objects in Object Oriented Programming (OOP) Language are in relationship with one another.
- Various kind of relationships are Association, Aggregation and Inheritance etc.
- An Association is the term used to represent the relationships among various Objects of one or more Classes .
- It is like a child inheriting the features of its parents .It is an ability to derive new classes from existing classes.
- A Derive Class is known as Sub Class which inherits the instance variables and methods of Super Class or Base Class and can add some new instance variables and methods.
- Poly means "many" and morphism means "forms" that is many forms.
- It means ability to take more then one form or actions of same property.
- Same functions with same function names can perform different actions depending upon which object call the function.
Advantages of Object Oriented Programming
- It is more suitable for the long projects.
- The projects executed using OOP techniques are more reliable.
- Abstraction techniques are used to hide the irrelevant details.
- Focus is only on the relevant part of the problem and solution.
- OOP divides the problems into collection of Objects
- Object Oriented Systems are easier to upgrade and modify.
- Software complexity can be better managed.
This comment has been removed by the author.
ReplyDelete