Objective Oriented Approach:
Object-oriented programming (OOP) is a programming language that organized around objects rather than “actions” and data rather than logic. Historically, a program has been viewed as a logical procedure that takes input data, processes it, and produces output data.
The object is defined as an instance of a class. An object has identity, state and behavior. These 3 are defines as features of an object.
“Identity” can be represented by specific identification number.
“State” can be represented by attributes of an “Object”.
“Behavior” can be represented actions and methods of an “Object”
Behavior can be represented in a specific form called “Camel casing”. The representation should be in the following form ”first word small letter followed by capital letters and no space among them” (turnRightAndStop()) . This Camel Casing is used to represent actions and methods.
Collection of similar objects is a class and Object can be an instance of class.
Different types of classes:
- Super Class
- Parent Class
- Generalized Class
- Specialized Class
- Sub Class
- Child Class.
The collection of classes is called as a Component. The component is represented as rectangle diagram.
Collection of classes which are not reusable in nature is called as “Package”.
Collection is classes which are reusable in nature.
Objective Oriented Approach implementation:
I am going to give you some details into the 4 important principles of “OOA”
Abstraction is simply defined as filter out objects properties and operations. i.e., “considering what is required and ignoring what is not required” in the model.
It uses information hiding technique to hide the complex internal structure. It is an information and complex hiding technique.
Child class inheriting the properties of parent class.
A single instruction can do multiple operations.
Relationships exist either between classes or between objects, but not between classes and objects. There are four types of relationships.
- Association: It has different types of relationships.
- Unary: It is a one way relationship
- Binary: A two way relationship
- Multiplicity: It tells about the number of objects in one class that relate to a single object in an associated class.
- Reflexive: It defined as reflexive association, this can happen when a class has objects that play a variety of roles.
This relationship is exists between generalized class and specialized class.
It is the “Part” and ”Whole” relationship. The Part remains even the Whole dies.
It is the “Part” and ”Whole” relationship. The part also dies along with whole.
- Message Sending:
The Objects are work together in a system. They perform this operation by sending message to one another. One object send message to another object to perform an operation.
These messages are sent by methods. Methods are represented by Camel Casing. Camel Casing means initial word will be all small alphabets and from second word onwards beginning alphabet is Capital and remaining are small.
Cael Casing representation:
In any Objective Oriented Approach “Classes are defined as basic building blocks of Code”. OOA is used to manage the complexity of software systems.