Object Oriented Programming - OOP Concepts
Class
It is the blueprint or sketch of object.
Object
It is realization of class or in other word
blueprint.
Encapsulation
When access to attributes is through some proper process. It may
be through method, class or interface.
Inheritance
When one class inherits the properties and
attributes of another class. In other words, it’s called overriding.
Polymorphism
It means many shapes or forms. When method or
constructor of same hit by some parameters considerations. Parameters are
Number of argument, Sequence of Argument, Data type of argument and return type
of argument. In other words, it’s called overloading.
Abstraction
Specifying a framework and hiding implementation
level detail. Solidity will be make on front of abstraction, which will provide
a sketch during implementation. It reduces complexity by hiding low level
detail. e.g. Electric switch hide the complexity of internal wiring by
providing switch interface.
Association
It’s the relationship between two objects and
define abundance between objects. It has of type one to one, one to many, many
to one and many to many. e.g. Faculty and Student have an association.
Aggregation
It’s the directional associations between two
objects. It specifies, which object contains other object. When an object
“has-a” another object than it became aggregation. e.g. Library has a Book.
Composition
A restricted aggregation is called composition.
When an object contains another object and also contained object existence is
dependent on container object. If container not exist, then there is no exist.
e.g. Class has a Student, if there is no class there will be no Student.
Library has a Book, if no Library Then Book still exist.
Dependency
Dependency is, when Change in one class
structure or behavior affects the other related class.
Generalization
“Is A” is a relationship, which redirect it from
specialization toward generalization. More specifically, it’s Inheritance. e.g.
Student and Faculty is a special type of Person.
Realization
It’s the relation between the blueprint and object class, that have
its implementation detail. This object realizes the blueprint class. More
specifically, relation between software interface and implementation detail.
e.g. Swift Model realize Car Abstraction.
Comments
Post a Comment