incubator-photark-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Luciano Resende <luckbr1...@gmail.com>
Subject Re: How to Implement a custom Java Class which is capable of moving through Tuscany services.
Date Mon, 01 Aug 2011 02:17:09 GMT
On Sun, Jul 31, 2011 at 2:12 PM, Subash Chaturanga <subashsdm@gmail.com> wrote:
> How to implement a custom Class which is capable of moving through Tuscany
> services ? What are the  mandatory attributes it should have ? Does it need
> to implement java Serializable interface explicitly? Does this class must
> have only Java natives as its state such as (String, int, ..) ?
>

In general, you want to have Java beans [1] that represent pure data
and have no behavior.  Having said that, this is really not a Tuscany
question, but a general question depending on how you are going to
serialize your class. Consider when you expose your service using a
Tuscany JSON-RPC binding, which under the cover is going to use
Jackson framework to serialize the object to json; in this case a Java
bean would do it, but you could even take advantage of some JAXB
annotations that are supported by Jackson. Now, if we consider
exposing a service with Tuscany REST binding using XML wireformat, we
need to understand some of the limitations we have when serializing
XML, particularly where arrays need to be wrapped, etc.

Well, hopefully this allows you to get going... if you want to discuss
some proposals, I'm happy to review and provide any feedback.



[1] http://en.wikipedia.org/wiki/JavaBean



-- 
Luciano Resende
http://people.apache.org/~lresende
http://twitter.com/lresende1975
http://lresende.blogspot.com/

Mime
View raw message