What is a serialized bean?

Andreas Schaefer

You can deliver a bean as either its bytecode (compiled Java code) or as a serialized object (after the bean instance is serialized to a file (*.ser)).

The difference is that when you load the bean by its bytecode the bean loader normally create an instance from it by calling the default constructor (no arguments constructor). If you have a serialized instance the loader creates the instance like it was when it was serialized and therefore its internal state is recreated (except transient fields).

Therefore you can provide already customized beans for a particular purpose instead of letting the bean user do this. So you can provide beans for the different Swing look and feels which vary in its background color, borders, fonts, etc. Then the bean user can select for the one he prefers instead of trying settings the bean properties.

See also:
0 Comments  (click to add your comment)
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact