wood burning stoves 2.0*
The moose likes Developer Certification (SCJD/OCMJD) and the fly likes Value Object Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Developer Certification (SCJD/OCMJD)
Bookmark "Value Object" Watch "Value Object" New topic
Author

Value Object

Bhavik Patel
Ranch Hand

Joined: Jul 12, 2004
Posts: 155
Does anyone follows this pattern for transferring the data back and forth...My method signatures accepts the String[] only ..so using Value Object may just add an extra layer but less network load...First question Value Object pattern is suitable here or not as the signature is purely with String[]...But the thing that concerns me is
In non-network mode, the database and GUI must run in the same VM and must perform no networking, must not use loopback networking, and[BOLD] must not involve the serialization of any objects when communicating between the GUI and database elements. [/BOLD]
..If i create lets say Record class as value object class then i must implement the Serializable..so will it break the specs as i will be using the same Record class in local mode (which should not involve serializable stuff)..really confused..


SCJP 1.4<br />SCWCD 1.4(91%)<br />Working on SCJD -Bodgitt & Scrapper Constructions...<br /> <br />"It takes 43 muscles to frown & 17 to smile but it doen't take any to just sit there with a dumb look on your face .. Keep Smiling "
Oricio Ocle
Ranch Hand

Joined: Nov 30, 2004
Posts: 284

Hello Bhavik.
I have implemented it for the exact find method.
..If i create lets say Record class as value object class then i must implement the Serializable..so will it break the specs as i will be using the same Record class in local mode (which should not involve serializable stuff)..really confused..

Implementing Serializable does not mean serializing. Really i cant undestand at all this requirement...

Regards.


SCJP, OCMJD, OCMJEA
Bhavik Patel
Ranch Hand

Joined: Jul 12, 2004
Posts: 155
thanks for the reply .. i was thinking the same (implementing serializable doesnt mean we are serializing) ...so its fine with implenting Value Object (which means we have to convert all time back & forth between Value Object & String array as DataAcess has methods with String[] in signature ) and implementing the serializable ...Is it acceptable to do so ?? or not a good idea...
Mihai Radulescu
Ranch Hand

Joined: Sep 18, 2003
Posts: 918

Hi Bhavik

The Value Object provides access on different data models in the same way, it have nothing to do with your network layer.
Serializable does not mean network, it only means that the specified Object can be serialized(and deserialized). A serialized object can be send to a stream.You can use it by example to make serialized object persistent.
If you are not happy with a Serializable Value Object you can have a simple one(not serializable) and then use the Decorator pattern to make it serializable Value Object.

Regards M.


SCJP, SCJD, SCWCD, OCPJBCD
 
Consider Paul's rocket mass heater.
 
subject: Value Object