• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Worker Beans and Serializable

 
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think it is common practice to implement JavaBeans (eg worker beans etc) with the serializable interface. Some books etc sometimes give examples that don't.
Also the same applies to providing a no args constructor.
When just using JavaBeans in say a MVC design pattern what is the common or correct practice.
What is the advantage and what is the correct practice. This is a source of confusion to me.
I wonder is someone could put in their two cents or pence( any currency is OK )
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
One possible reason for making any helper class serializable is that if you store an instance in a session, the servlet engine may be able to store the session out to disk to save memory.
Bill
[ March 06, 2002: Message edited by: William Brogden ]
 
Eric Howell
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks for that Bill.
I get a little confused with definitions.
I wonder, how could we best define a 'worker bean'.
Would it be a bean used by the JSP to do a job eg displaying some info from the db or some connection etc. How would it differ in definition from another bean.
Also, could a bean called from a servlet (in an MVC type system) be defined as a worker bean.
Thanks in advance
 
So you made a portal in time and started grabbing people. This tiny ad thinks that's rude:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic