Currently, the service engine classes are a bit muddled. GenericDispatcher (the default LocalDispatcher implementation) and DispatchContext have feature envy. Some functionality in DispatchContext belongs in ServiceDispatcher.

I would like to clean this up a bit and provide better separation of concerns. The service engine API will not change - the work will be done "under the hood."

My hope is to get the code to a point where DispatchContext becomes less integral to its neighbors, and it becomes more of a single-use lightweight container. Again, this will not change the API at all.

However, it will open up the possibility to improve the API. For example, instead of this service implementation:

public static Map<String, Object> myService(DispatchContext dctx, Map<String, Object> context) {
  Locale locale = (Locale) context.get("locale");
...

we could have:

public static Map<String, Object> myService(DispatchContext dctx) {
  Locale locale = dctx.getParameter("locale");
...


What do you think?


--
Adrian Crum
Sandglass Software
www.sandglass-software.com

Reply via email to