matryoshka-model / matryoshka

A lightweight framework that provides a standard and easy way to implement a model service layer
BSD 2-Clause "Simplified" License
4 stars 3 forks source link

[WIP] Facade operations #37

Open leodido opened 9 years ago

leodido commented 9 years ago

Following from #35 and #36 we can now describe the following general operations.

General operations

Operations find, save, delete, and pagination are all representable with invocation operations.

Naming

I'm not sure if would be better to call invokation as composable operation.

What do you think about? cc @leogr.

Matrix

Find Save Delete Pagination Invocation
with() :ballot_box_with_check: :ballot_box_with_check:
within() :ballot_box_with_check: :ballot_box_with_check:
this() :ballot_box_with_check:

Notes

Terms will have different/restricted meaning and behaviour depending of the operation type their are executed on.

leogr commented 9 years ago

Pagination is similar to Find: it has within() and with(), but a PaginableCriteria must be enforced instead of the ReadableCriteria. Also Delete has within() and with(), but DeletableCriteria must be enforced.

Invocation is different: within() cannot be defined (it could work with multiple models) and multiple with() could be required. Furthermore the with() behaviour of Invocation is different: a closure can depends on any kind of interface, not CriteriaInterface only