Factlink / pavlov

Provides a Command/Query/Interactor framework.
MIT License
22 stars 4 forks source link

Backend (work in progress, not ready for merge) #32

Closed marten closed 10 years ago

marten commented 11 years ago

Future plan for the OperationFinder might be to make it chainable:

class Queries::Post::FindByAuthor
  # ...
end

backend.queries.post.find_by_author(...)

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.

tomdev commented 11 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(...)
marten commented 11 years ago

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.

jjoos commented 11 years ago

Was more thinking about this as an additional feature...