Hi,

Would it be feasible or indeed sensible(?) to convert/adapt Tapestry to
render JSON?

Page classes would provide API endpoints and unpack params and body content
to properties and the templates would have JSON instead of TML. I'd also
want to modify the tapestry tags (t:if t:loop etc) to something much more
simple and JSONesque.

The page classes would support the GET/POST/PUT and so forth by convention.
I also envisage being able to filter, resort and augment responses through
an execution chain.

i.e: a JSON template

{
    "id": $,
    ?"name": $,
    <prices id='$' orderBy='ASC'>,
    "tags": [$]}


$ would call corresponding getter methods e.g. getId, getTags etc..
? would invoke hasName and render the name value if true
<> would embed components - <prices...> could render "prices" : [1,2,3],

I'd like to harness Tapesty to emit JSON from rendering char streams
instead of having to use concrete domain classes that have to be reflected
and such as per JAXB and other similar frameworks that seem to make a meal
of JSON. I'd like plastic to convert the template into stream emitter
methods that are called transparently in the plastic classes. Hiding the
boilerplate code

I like the idea of writing the JSON template myself, it's clearer more
flexible and can stream and follows the ethos of Tapestry. Reflection must
slow the rendering down a lot.

Is this crazy, any thoughts? I want to have flexibility and write minimum
code, and max reuse things Tapestry is good with.

John

Reply via email to