Violating the Single Responsibility Principle?
We are creating a one-to-many relationship in a class, for example, a student can have many books.
Single Responsibly Principle
When we are a making a one to many relationship in a class. For example, A Student can have many Books.
In the class are we not breaking the Single Responsibility Principle?
Because Student Class has it’s own Business Logic. Moreover it would also have logic to Add Remove Book…
Similarly the Student can have many EnrolledSubjects too.
Single Responsibly Principle
When we are a making a one to many relationship in a class. For example, A Student can have many Books.
In the class are we not breaking the Single Responsibility Principle?
Because Student Class has it’s own Business Logic. Moreover it would also have logic to Add Remove Book…
Similarly the Student can have many EnrolledSubjects too.