click-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bob Schellink <>
Subject Re: Click Services
Date Tue, 14 May 2013 19:43:37 GMT
On 2013/05/14 15:45, Malcolm Edgar wrote:
> I think this is an interesting discussion.  I am seeing existing Multiple Page Applications
> which is Clicks forte, evolve into hybrid MPA / Single Page Applications (SPA) using
frameworks like
> AngularJS.
> For serving JSON/RPC we have been using both hand coded Servlets with net.sf.json.JSONSerializer
> using services built with RESTEasy (  The RESTEasy approach
> more idiomatic Java (lots of layers of abstraction) and works well 99% of time.
> I am not sure what the value Click could provide for services.

Nods, we will be reinventing the wheel a bit.

  While I agree Velocity templates
> would be useful for rendering a JSON response, the main problem in this space is marshalling
> request data into Java objects. Maybe Marco google library would be good for this.

I'm currently using GSON[1], mostly because their docs is straightforward.

> How would you see the services being registered, e.g. XML definition or auto-mapped some
how ?

Guess annotation based but it looks like a pain to discover the annotated classes. There are
libs to help with that part but EE environments are tricky eg. JBoss 7 has a custom file system

implementation which is tricky to 'scan'. Preprocessor could also be used at compile time
discover annotated classes and build an index of classes.

One could also use plain interfaces and build up a cache at runtime eg: each request that
matches a 
valid class is placed in a map and cached for faster retrieval in the future.

Kind regards



View raw message