File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Serializable domain objects

 
Andrei Antonescu
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Can you please explain why is it best practice to serialize the Plain Old Java Objects we use in a Java Web App?

Thanks in advance
 
Steve Luke
Bartender
Pie
Posts: 4181
21
IntelliJ IDE Java Python
  • 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It is often for scalability. You put the Objects into a Context, and they hang around for a while. As your server starts to get more hits, it will eat up more memory. Since not all the Objects that were created are in active use, then some of them can be Serialized to disk to get them out of RAM, and make way for more use. Then when those Objects are needed again they are Deserialized and put into action.

Another scalability factor is Clustering. When your site starts to get a lot of hits, and resources start to become an issue you can deploy your application on a Cluster. In this case you may have several Servers running the same application - and they will need access to the same data. So the servers can serialize the Objects and pass them from one node in the Cluster to another.

 
Andrei Antonescu
Ranch Hand
Posts: 75
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Steve. That is a very good point.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic