Hi all,
I am now working on preparing API for Provider and ProviderAccount resources
so I want to ask some questions regarding controllers for API.
At this moment there are some controllers in API namespace and so there is duplicated functionality between UI and API parts.
In the future we will be adding features to API and CLI tool too.
I think that we need to decide wheter keep UI and API controllers separated or merge them together.
I think that best will be to merge them together.
Controller should be as skinny as possible with minimum logic (parameters sanitizing, model call, render results - view or whatever).
Controller should respond to html, js, json, xml, etc...
All the logic now present in controllers should be moved to models or some other classes which will work with models (delegators, decorators, name it...)
Please, write your thoughts and/or experience with this kind of problem.
--
With regards
Petr Blaho