Relative Content

Tag Archive for single-responsibility

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 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.