• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

non-network mode serialization?

 
mark ken
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In non-network mode, my requirement doc say:

The program must be able to work in a non-networked mode. In this mode, the database and GUI must run in the same VM and must perform no networking, must not use loopback networking, and must not involve the serialization of any objects when communicating between the GUI and database elements.

I'm confused with must not involve the serialization of any objects
what this means? Does it mean I can not define and use any class which implement serialize interface in non-network mode.
because I'm going to wrap the data as a class object.In network mode, I have to implement serialize interface to make this class can be delivered from server side to client side.

but , In non-network mode can I use the same object ? i mean I use it just for local .

thank you very much.
 
Ronald Wouters
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Does it mean I can not define and use any class which implement serialize interface in non-network mode.


No it does not or you wouldn't even be able to use a simple String. java.lang.String implements Serializable also

Regards,
Ronald Wouters
 
mark ken
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are right.
thank you Ronald.
 
woo sung hwang
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi. I also have same problem and i still not sure what should i do for coding.

"must not involve the serialization of any objects" in non-networked mode.

My guestion is that client will ask the Data class directly(i.e. data.read(recordNumber) ) and will return Srting array or any other return value.
If String array will be retruned, it would be serialization object. isn't it? because String is serialization object.

am i right?

if so, what can i do?
how can i avoid it? what kind of return value are valid?
 
Ronald Wouters
Ranch Hand
Posts: 190
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If String array will be retruned, it would be serialization object. isn't it? because String is serialization object.


Hi,

it is important to understand that just because an object implements the java.io.Serializable interface, does NOT necessarily mean that "serialization" will ALWAYS occur. It just means that the object, say like a String or a custom made value object, CAN be serialized/deserialized.

When everything is happening locally, in a single VM, as is the case when you run the application in standalone mode, when no RMI stuff is happening what so ever, then obviously there is no need to "serialize" (send over the network) anything at all. The fact that the objects you are using as parameters and return values implement the java.io.Serializable interface is irrelevant in this case.

I hope this clears things up.

Regards,
Ronald Wouters
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic