4 ms·
This is a good read, and something I agree with. The command pattern that you're showing here almost feels like the "write" inverse to the Presenter "read" acti
by ecoffey 14y ago
This is a good read, and something I agree with. The command pattern that you're showing here almost feels like the "write" inverse to the Presenter "read" action.
The way I've been thinking about it for myself is to imagine your Domain Objects as this 3D space of object relationships and interactions. So a Presenter cuts a 2D plane through that space and let's you view from a certain perspective.
In the case of Commands, you're taking a certain perspective and mutating that 3D space through it.
Not sure if that helps anyone else :-)
Also the focused_controller project looks really interesting as well. I was working on my own web framework, that made Actions first class objects as well. And since it was built on this slick IoC library, your Actions could just declare they need this Command, or these two Services to complete the request and they would automagically get them. I really like the idea of "one object(graph) to represent accomplishing a task", and then just having that object(graph) go do the work.