yeago/django-subscription

Improvement: decouple view from model logic

jpic opened this issue · 1 comments

jpic commented

Currently the backend is in charge of both the model logic (storage, and soon retrieval) and the view logic (text formatting ...).

So, purely theorical question: what if the user wants the same view logic with 2 different model logics ? I can't see how that would be useful in my project, and probably in yours too ....

In practice, just dividing Backend.__init__ into pieces like i did in my fork just works and the defaults look sensible.

Personnaly, i'm all for implementing the simple & pragmatic approach which i implemented in my fork (probably not as-is thought, we should design it together) rather than the purely academic design with 2 classes (one for view, one for model). At least until someone finds a real use case for this.

What do you think ?

jpic commented

In the end I think we should remove the text/actor/format_kwargs and all rendering logic from the backend and leave this to the view. On the fly rendering would be a major improvement.