3 ms·
This seems to be a new trendy design pattern: wrap a single method with a class and claim you just discovered a pinnacle of object-oriented design since you res
by stiff 14y ago
This seems to be a new trendy design pattern: wrap a single method with a class and claim you just discovered a pinnacle of object-oriented design since you respect the "Single Responsibility Principle"...
- alisnic 14y ago> claim you just discovered a pinnacle of object-oriented design since you respect the "Single Responsibility Principle"... I never said that, why all the hate? I stated pretty clear that this is my approach on things, and I never pretended it to be the "right" one.
- mattgreenrocks 14y agoDon't sweat it! People tend to adopt different subsets of OOP and then proclaim all other subsets are wrong. Example: large-scale objects that are heavily procedural vs lots of smaller grained objects that adhere to SRP. I've written a lot of code in both styles, and determined that SRP is a good force on my designs.
- bengotow 14y agoI think what the OP is talking about is just a ruby reimagination of the Operation pattern. Most sufficiently complicated apps that implement undo / redo use "Single Responsibility Objects" to encapsulate individual user operations. Each one has a "do" method and an "undo" method, and little else. In a web service, you don't have to worry about undo server-side, so using this pattern is more an option than a necessity!