Merge / split controller for UI and API?

Tomas Sedovic tsedovic at redhat.com
Tue Mar 27 09:30:36 UTC 2012


On 03/26/2012 04:54 PM, Petr Blaho wrote:
> 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.
>

I'm for the merge as well. No need to repeat the good arguments the 
others posted already.

Thomas



More information about the aeolus-devel mailing list