Do setters and getters always break the Single-Responsibility Principle?
As we know, The SRP states that every class should have single responsibility and that responsibility must be entirely encapsulated by the class.
Can/should the Single Responsibility Principle be applied to new code?
The principle is defined as modules having one reason to change. My question is, surely these reasons to change are not known until the code actually starts to change?? Pretty much every piece of code has numerous reasons why it could possibly change but surely attempting to anticipate all of these and design your code with this in mind would end up with very poor code. Isn’t it a better idea to only really start to apply SRP when requests to change the code start coming in? More specifically, when a piece of code has changed more than once for more than one reason, thus proving it has more than one reason to change. It sounds very anti-Agile to attempt to guess reasons for change.
Is Domain Entity violating Single Responsibility Principle?
Single responsibility ( reason to change ) of an entity should be to uniquely identify itself, in other words, its responsibility is to be findable.
Is it good to have an interface plenty of methods which belong to different concepts, just to preserve the Liskov’s Principle?
I’m currently studying a course based on Software Design and I had a discussion in class with my professor and some classmates about a problem represented by the next scenario:
Is this a Single Responsibility Principle violation?
I’m designing an OO graph library and at the moment I’m trying to figure out the design for a GraphEdge
class. I’ve added setters and getters for it’s nodes, direction and weight. This seemes perfectly reasonable.
Is this a Single Responsibility Principle violation?
I’m designing an OO graph library and at the moment I’m trying to figure out the design for a GraphEdge
class. I’ve added setters and getters for it’s nodes, direction and weight. This seemes perfectly reasonable.
Is this a Single Responsibility Principle violation?
I’m designing an OO graph library and at the moment I’m trying to figure out the design for a GraphEdge
class. I’ve added setters and getters for it’s nodes, direction and weight. This seemes perfectly reasonable.
Is this a Single Responsibility Principle violation?
I’m designing an OO graph library and at the moment I’m trying to figure out the design for a GraphEdge
class. I’ve added setters and getters for it’s nodes, direction and weight. This seemes perfectly reasonable.
Is this a Single Responsibility Principle violation?
I’m designing an OO graph library and at the moment I’m trying to figure out the design for a GraphEdge
class. I’ve added setters and getters for it’s nodes, direction and weight. This seemes perfectly reasonable.
Is this a Single Responsibility Principle violation?
I’m designing an OO graph library and at the moment I’m trying to figure out the design for a GraphEdge
class. I’ve added setters and getters for it’s nodes, direction and weight. This seemes perfectly reasonable.