This week's book giveaway is in the Agile and Other Processes forum.
We're giving away four copies of The Little Book of Impediments (e-book only) and have Tom Perry on-line!
See this thread for details.
Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

serialization

 
GD Deepz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
This is what Sun says in the user requirements:


"Non-Networked Mode
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.
The operating mode is selected using the single command line argument that is permitted. Architecturally, this mode must use the database and GUI from the networked form, but must not use the network server code at all"


Ok, my program bypasses all networked code in standalone mode BUT serialization of objects is still happenning. I have a class that functions as a serialized JavaBean. A new JavaBean is created for each new row of data in the persistent storage. The beans are created and cached in an ArrayList(container)in the backend layer. This only happens once when the program first loads. The bean instances are never sent over the wire even in Network mode. Only data contained in the bean are sent over the wire.

Will this cause automatic failure for standalone mode because I am still performing serialization, eventhough serialization objects are never sent across the wire.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi GD,

Where is serialization taking place in your solution?

You have mentioned that your beans are implementing the Serializable interface, but I am not sure why you are doing this. Since the data is physically stored in the data file provided by Sun, I doubt that you are writing the bean data to disk. And you have stated that the bean itself is not transferred to the client. So I am not clear where the serialization is occuring, or why it would occur.

Regards, Andrew
 
GD Deepz
Ranch Hand
Posts: 55
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Andrew for you reply. I think you are right, serialization might not be required for my design. This is what is happenning:

1. On application start, data is read from the flat file. A new bean that implements serializable is created for each row of data. These beans are then stored in ArrayList in the backend. Each bean is identified by a record number

2. The beans are never sent over the wire to the client. For example, if a client want to do a search, the required bean(s) are accessed in the ArrayList, data contained in the beans is then sent over the wire to the client. The beans itself which are serialized are never sent across the wire.

So serializing my beans MIGHT NOT required. Am I correct.

TKS
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12014
220
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi GD,

Not only serialization does not appear to be required, I cannot see it happening in your circumstance .

You could try taking off the 'implements serializable' statement in your class and confirm that is still works.

There is no problem with having a class implement serializable in the assignment, as long as serialization does not occur in single user mode. But I would generally steer clear of having any classes implement serializable where they are not needed, just so that the assessor does not spend any time verifying that serialization is not occurring.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic