What are the important paradigms for Developing the Clean Object-Oriented Code?

By | August 11, 2019

In this blog post we will discuss about What are the important paradigms for Developing the Clean Object-Oriented Code?

We should always keep in mind below key points when you write code in your application:

  1. We should use an Interface (or the Super Type) not the implementation.
  2. Classes Interacting each other should be loosely coupled among themselves.
  3. We should write code in such a way so that it should implement tight encapsulation. Use of public and static variables should be avoided wherever possible, they introduce coupling and make testing of classes tough. Avoid the Singleton Design pattern wherever possible.
  4. We should always reuse the existing code using Inheritance, Composition and Utility Methods. We should strictly follow the Do not Repeat Yourself (DRY) principle.
  5. We should use Has-A relationship because Has-A relationship is better than Is-A relationship it offers more flexibility, see Decorator Design Pattern in java.io. * package for more details.
  6. In case of multi-threaded applications, we should use immutable objects to represent the state.
  7. We should make proper use of Design Patterns wherever possible.
  8. We should always use up to date software dependencies & make best use of latest technology available to us.

You may also Like:

Why Java is not 100% Object-oriented language?
Can we call static method with null object?
Can we override static method in Java?
What will be the output of following java program?
What is the difference Between java.util.Date and java.sql.Date in Java ?
Why Prime Numbers are considered in writing certain algorithms like hashcode()?

That’s all about  What are the important paradigms for Developing the Clean Object-Oriented Code?
If you have any feedback or suggestion please feel free to drop in blow comment box.

Leave a Reply

Your email address will not be published. Required fields are marked *