Relative Content

Tag Archive for c#ooprelationshipsingle-responsibility-principlesolid

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.