You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@myfaces.apache.org by Dennis Byrne <de...@dbyrne.net> on 2006/04/04 07:14:45 UTC

What's a POJSO ?

Hello community,

There are plenty of great frameworks that allow us to marshall entities back and forth between our POJOs and the DB.  Does any know of a way to marshall entities back and forth from our POJOs and the client side?  What I want is to just point a tag at a java business object and have it render as a POJSO ...

<s:pojso value="#{back.pojo.class}" /> render class ( function )
<s:pojso var="myPojo" value="#{backer.pojo}" /> render instance
<s:pojso var="myPojos" value="#{backer.pojoList}" /> render array
<s:pojso var="myPojos" value="#{backer.pojoMap}" /> render associative array

In order to render an input field w/ the onchange event syncing the value w/ the *client* side entity w/ *no* postback ...
<h:inputText id="zipcode" value="#{backer.pojo.zipCode}" >
  <s:valueChangeListener for="myPojo" />
</h:inputText>
<s:pojso var="myPojo" value="#{backer.pojo}" />

There could be lots of facets for the extra stuff ( disable getters/setters, how deep to walk the POJO graph, which properties to exclude, etc.).  I would envision using bindings for the facets so that application developers do not have to repeat this across every JSP, or facelet if your initials are M.K. :)

Perhaps there are non-JSF ( or non-Java ) implementations of the concept already ?  How deep does the ADF rabbit hole go?

I am not interested in AJAX method invocation because DWR already does this good - nor so much getting POJSOS to POJOS ( which JSON kind of does ).  I am more or less trying to "move the conversation" to the browser w/out doing a lot of grunt work.

Dennis Byrne



Re: What's a POJSO ?

Posted by Craig McClanahan <cr...@apache.org>.
On 4/3/06, Dennis Byrne <de...@dbyrne.net> wrote:
>
> Hello community,
>
> There are plenty of great frameworks that allow us to marshall entities
> back and forth between our POJOs and the DB.  Does any know of a way to
> marshall entities back and forth from our POJOs and the client side?  What I
> want is to just point a tag at a java business object and have it render as
> a POJSO ...
>
> <s:pojso value="#{back.pojo.class}" /> render class ( function )
> <s:pojso var="myPojo" value="#{backer.pojo}" /> render instance
> <s:pojso var="myPojos" value="#{backer.pojoList}" /> render array
> <s:pojso var="myPojos" value="#{backer.pojoMap}" /> render associative
> array
>
> In order to render an input field w/ the onchange event syncing the value
> w/ the *client* side entity w/ *no* postback ...
> <h:inputText id="zipcode" value="#{backer.pojo.zipCode}" >
>   <s:valueChangeListener for="myPojo" />
> </h:inputText>
> <s:pojso var="myPojo" value="#{backer.pojo}" />
>
> There could be lots of facets for the extra stuff ( disable
> getters/setters, how deep to walk the POJO graph, which properties to
> exclude, etc.).  I would envision using bindings for the facets so that
> application developers do not have to repeat this across every JSP, or
> facelet if your initials are M.K. :)
>
> Perhaps there are non-JSF ( or non-Java ) implementations of the concept
> already ?  How deep does the ADF rabbit hole go?
>
> I am not interested in AJAX method invocation because DWR already does
> this good - nor so much getting POJSOS to POJOS ( which JSON kind of does
> ).  I am more or less trying to "move the conversation" to the browser w/out
> doing a lot of grunt work.


Since you never answered the question in your subject line :-), I am
presuming that POJSO means Plain Old JavaScript Object, right?

Given that, JSON has primitives for the Java->JS conversions (things like
JSONStringer and JSONWriter) in addition to the primitives for JS->Java.  Is
what you are after some sort of wrapper around this (that avoids all the low
level mechanics to assemble the JSON stream)?  That would seem like a pretty
nice gadget to have in your toolbox when you have a nice set of POJOs
modelling the data on the server side already.

Encapsulating something like this in JSF components would be duck soup ...
maybe <t:saveJSON> instead of <t:saveState> :-)

Dennis Byrne
>
>
> Craig

Re: What's a POJSO ?

Posted by Craig McClanahan <cr...@apache.org>.
On 4/3/06, Dennis Byrne <de...@dbyrne.net> wrote:
>
> Hello community,
>
> There are plenty of great frameworks that allow us to marshall entities
> back and forth between our POJOs and the DB.  Does any know of a way to
> marshall entities back and forth from our POJOs and the client side?  What I
> want is to just point a tag at a java business object and have it render as
> a POJSO ...
>
> <s:pojso value="#{back.pojo.class}" /> render class ( function )
> <s:pojso var="myPojo" value="#{backer.pojo}" /> render instance
> <s:pojso var="myPojos" value="#{backer.pojoList}" /> render array
> <s:pojso var="myPojos" value="#{backer.pojoMap}" /> render associative
> array
>
> In order to render an input field w/ the onchange event syncing the value
> w/ the *client* side entity w/ *no* postback ...
> <h:inputText id="zipcode" value="#{backer.pojo.zipCode}" >
>   <s:valueChangeListener for="myPojo" />
> </h:inputText>
> <s:pojso var="myPojo" value="#{backer.pojo}" />
>
> There could be lots of facets for the extra stuff ( disable
> getters/setters, how deep to walk the POJO graph, which properties to
> exclude, etc.).  I would envision using bindings for the facets so that
> application developers do not have to repeat this across every JSP, or
> facelet if your initials are M.K. :)
>
> Perhaps there are non-JSF ( or non-Java ) implementations of the concept
> already ?  How deep does the ADF rabbit hole go?
>
> I am not interested in AJAX method invocation because DWR already does
> this good - nor so much getting POJSOS to POJOS ( which JSON kind of does
> ).  I am more or less trying to "move the conversation" to the browser w/out
> doing a lot of grunt work.


Since you never answered the question in your subject line :-), I am
presuming that POJSO means Plain Old JavaScript Object, right?

Given that, JSON has primitives for the Java->JS conversions (things like
JSONStringer and JSONWriter) in addition to the primitives for JS->Java.  Is
what you are after some sort of wrapper around this (that avoids all the low
level mechanics to assemble the JSON stream)?  That would seem like a pretty
nice gadget to have in your toolbox when you have a nice set of POJOs
modelling the data on the server side already.

Encapsulating something like this in JSF components would be duck soup ...
maybe <t:saveJSON> instead of <t:saveState> :-)

Dennis Byrne
>
>
> Craig