You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 3, 2021. It is now read-only.
Opening this issue to discuss how the Model layer is going to be implemented.
I propose we implement the Data Mapper [1] pattern instead of the currently planned Active Record pattern. I say this because that while the Active Record pattern may be easy at first and faster to implement, it violates the single responsibility principle in that it concerns itself with both domain logic and persistence [2]. Also as Titon is a framework, it needs to be as flexible as possible so decoupling is key.
To go along with the Data Mapper pattern, there is also usually a service layer. All this service layer does is marry domain objects to their data mappers and are the end-user interface. You would then use a service in, say, the controller layer [3].
This whole pattern adds extra complexity through layers of abstraction, but it is much more extensible and testable. Thoughts?