Category Archives: Data structures and Algorithms

Association Aggregation and Composition in Java

In this post. We will talk and learn about Association Aggregation and Composition in Java Association Association is the relation between two separate classes or entities that establish through their Objects. We can categorize associations in the following types: one-to-one one-to-many many-to-one many-to-many. In the Object-Oriented programming world, an Object can communicate with other Objects by… Read More »

Dependency Inversion Principle (DIP)

This principle says the decoupling of software modules. This way, instead of high-level modules depending on low-level modules, both have to depend on abstractions The classical example of this principle of bean configuration in the Spring framework. Another very good example of this principle: When you go to a local store to buy something, and you decide… Read More »

Interface Segregation Principle (ISP)

This principle says: “Clients should not be forced to implement unnecessary methods which they do not use” Let’s take an example. A Developer is created an interface Reportable and added two methods generateExcelReport() and generatedPdfReport(). Now a client wants to use this interface but he intends to use reports only in PDF format and not in excel. Will he be… Read More »

Single Responsibility Principle

Single Responsibility Principle (SRP) In our application-level code, we define model classes to represent real-time entities such as Employee, Person, Admin etc. Most of these classes are examples of SRP or Single responsivity Principle because when we need to change the state of an Employee only then we will modify an Employee class and if… Read More »

SOLID Design Principles

Classes are mainly the building blocks of any Software or application. If these blocks are not designed properly, the application or software is going to face a tough time in the future in terms of maintenance. This essentially means that not so well-written classes can lead to very difficult situations when the application scope goes… Read More »