[newbe]Transfer objects

P

polilop

Is it possible to make Transfer object (as i found somwhere, known as:Value
object's) with POJO's.
If so, any tutorials on the web would be appriciated (been googl-ing but
found only with ejb's).
Thanks
 
A

Alex Hunsley

polilop said:
Is it possible to make Transfer object (as i found somwhere, known as:Value
object's) with POJO's.

Yes. Just write a java class with some member values that can be set (or
specified at constructor time) and also get. Rather than writing
getters, if the value object/transfer object is immutable (won't change
after creation), it's worth considering making the member values public
final and hence allowing direct access to them.
 
P

polilop

Thanks for reply. Have you any web-s, tutorials like that involve database
with TO-s (POJO's) ?
 
A

Alex Hunsley

polilop said:
Thanks for reply. Have you any web-s, tutorials like that involve database
with TO-s (POJO's) ?

One of the best places I know for this is Sun's own Core J2EE patterns site:

http://java.sun.com/blueprints/corej2eepatterns/

It's also available as a book, but the patterns are all there on the web
page above. Example: click on the "Core J2EE Patterns Catalog" link,
then click on "Transfer object" in the graphic.
HTH,
lex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,768
Messages
2,569,574
Members
45,050
Latest member
AngelS122

Latest Threads

Top