ofbiz-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ean Schuessler <...@brainfood.com>
Subject Separation of concerns in the ControlServlet
Date Thu, 03 Apr 2014 20:36:09 GMT
In our internal development we have been working to keep our app
logic inside services and not let it leak out into the web action
code. In general, we're basically working to eliminate the use of
code in the actions and move it all the way out to client side
javascript. By the time the client talks to OFBiz in our current
work it is typically the direct invocation of a service.

One challenge we have noticed is dealing with cookies and session
attributes. We are thinking that it is an oversight that the 
Controller allows a service to read from parameters and session
values but does not allow it to write back to them. If the mode
is OUT and the session-attribute-name value is set then the
outbound value should be written to the session. If this was
expanded to allow cookie and localStorage values then most 
interactions could be reduced entirely to service invocations.

We talked about opening a bug for this but thought that it might
make sense to discuss it and clarify the idea with a little group
discussion.

There are some additional changes we would like to see for adding
the HTTP method as part of the binding for service invocations.
For instance:

/profile + GET = read a profile
/profile + PUT = create new profile
/profile + POST = update a profile
/profile + DELETE = delete a profile
... etc...

This would allow better support of RESTful client side 
technologies like Backbone.js.

-- 
Ean Schuessler, CTO
ean@brainfood.com
214-720-0700 x 315
Brainfood, Inc.
http://www.brainfood.com

Mime
View raw message