Closed marten closed 10 years ago
@jjoos says: "If we would have something like entities we could mount
interactors/operations in those entities."
class Backend::Interactor::Post::FindByAuthor
# ...
end
class Backend::Post
# ...
end
Backend::Post.find_by_author(...)
However, that would also make it significantly harder for people to gradually introduce Pavlov to their codebase, since they have to make entities for everything that they already have e.g. ActiveRecord models for.
It also implies that every interaction/operation has one entity, which I'm not sure is true. In fact, RoQua tends to use Pavlov exactly in the cases where things don't map well to a single model.
Was more thinking about this as an additional feature...
Future plan for the OperationFinder might be to make it chainable:
If we then make it so that backend also works like this, we could do
backend.post.queries.find_by_author
or whatever style the user desires. Doesn't even need to be split into queries/commands/interactors at that point, you could introduce more or less categories as desired.