Object Oriented Thought Process
Object Oriented Thought Process
XML JSON
Imperative Programming
What's An Object
Dog Object
What's a Class ???
Abstraction & Inheritance
Inheritance Types
An Interface
Object Encapsulation
Polymorphism
Class Diagram
Dependency Aggregation
Bidirectional Association
Inheritance Relationship
Generalization Realization
Think In-terms of Object
- Workshop
Design a class level diagram for,
• RVCE
• Car
Java Memory : Stack & Heap
Java Memory : Stack & Heap
More Object-Oriented Concepts
Error Handling
Constructors
- Default Constructor
- Overloading Constructors
- Super ()
Cohesion & Coupling in OOD
OOD- SOLID Principles
In software development, Object-Oriented Design plays a crucial role when it comes to writing flexible, scalable, maintainable, and reusable code.
There are so many benefits of using OOD, but every developer should also have the knowledge of the SOLID principle for good object-oriented design in programming.
The SOLID principle was introduced by Robert C. Martin, also known as Uncle Bob and it is a coding standard in programming.
This principle states that “a class should have only one reason to change”
which means every class should have a single responsibility or single job or single purpose.
Advantages
e cases :
Pizza Delivery
Bank Account
This principle states that “software entities (classes, modules, functions, etc.) should be open for extension,
but closed for modification”
“A class is closed, since it may be compiled, stored in a library, baselined, and used by client classes.
But it is also open, since any new class may use it as parent, adding new features. When a descendant class is defined,
there is no need to change the original or to disturb its clients.”
Use cases :
• Cuboid
• Bank Account
OOD- SOLID Principles
e principle defines that objects of a superclass shall be replaceable with objects of its subclasses without breaking t
plication. That requires the objects of your subclasses to behave in the same way as the objects of your superclass.
OOD- SOLID Principles
Liskov Substitution Principle
OOD- SOLID Principles
The Interface Segregation Principle
The Interface Segregation Principle was defined by Robert C. Martin while consulting for Xerox to help them build
the software for their new printer systems.
He defined it as:
“Clients should not be forced to depend upon interfaces that they do not use.”
OOD- SOLID Principles
The Interface Segregation Principle
OOD- SOLID Principles
Dependency Inversion
The Interface Segregation Principle was defined by Robert C. Martin while consulting for Xerox to help them build
the software for their new printer systems.
Based on this idea, Robert C. Martin’s definition of the Dependency Inversion Principle consists of two parts:
• High-level modules should not depend on low-level modules. Both should depend on abstractions.