There are many Object-Oriented Design (OOD) principles. But there are only four basic concepts of an Object-Oriented programming (OOP) language:
Object/Class that requires to keep the state and the behavior together,
- Encapsulation that requires to hide the state and details of the implementation,
Inheritance that allows propagating behavior/signatures down the chain of class/interface extensions,
Interface/Abstraction that isolates
signatures (API) form their implementations,Polymorphism that allows an object to be represented by any of the implemented interfaces and any of the base classes, including java.lang.Object.
A good OOD has the following qualities:
flexible for adapting the new changes (inevitable as taxes),
- clear communicating the system structure and specialization of each part,
using well-defined domain terminology while naming the system components,
allows testing the system components in isolation and together (integrated).
All the above OOD qualities are easily achievable if the programmers/designers honor and take advantage of the OOP concepts, among which Encapsulation and Interface/Abstraction are the main two. They address the problems that plagued the programming before OOP:
unregulated shared access to the data (state), and
lack of flexibility changing the implementation details even in the cases when the protocol between system components remain is not affected.
In addition, the good OOD (that honors OPP concepts) facilitates more flexible development process by clearly separating the responsibilities and isolating the implementations behind the interface facade.
Read more detailed discussion of this topic in the following books:
Send your comments using the link Contact or in response to my newsletter.
If you do not receive the newsletter, subscribe via link Subscribe under Contact.