Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / JavaBeans / October 2003

Tip: Looking for answers? Try searching our database.

JavaBeans - newbie

Thread view: 
Francois - 15 Oct 2003 17:43 GMT
Hi everyone, I am new to using Javabeans but would like to clear a few
questions I have regarding beans:

1.) Can a Javabean contain logic or is it only a container for data.
2.) Can a Javabean extend another class and if so how does this affect the
properties exposed by a bean. (Properties from parent if parent is a
Javabean).
4.) How should static variables be used in beans e.g. constants to indicate
state of a bean.

Sorry if these questions are a bit on the silly side, but any help would be
greatly appreciated.

Regards,
Francois
Francois - 15 Oct 2003 22:18 GMT
Thanks a million Gary, that does clear up allot!

Elaboration on point number 4:
What about static constants in a JB or EJB to indicate valid
values allowed for a bean property?

Sorry about number 3, but it should read the following:
I am aware that a Beans should have a public default constructor to be
considered a true JB, but what happens in the case of true inheritance using
JBs, should I need to include the call to super() to force initialization of
object variables (setting default values) in the parent class?

Once again it is great to know that there are people out there that can help
a person like me on the right path!

Regards,
Francois

-------------------------------------------------

Hi Francois,

depends on whether or not you are talking enterprise Java-Beans (aka EJB) or
plain vanilla java-beans (JB). The answers are:

1) Can contain logic AND data for JB. For EJB generally "session" beans
contain logic, and "entity" beans are for data representation.

2) You can extend classes with JB and EJB; although creating complete
inheritance hierarchies is best suited for JB.

3) ? No (3)

4) Generally statics are used for constants or to singleton references.
According to the EJB specification you should not use static variables (or
threads or access the file system) with EJB's.

Hope this is of some use.

Gary

> Hi everyone, I am new to using Javabeans but would like to clear a few
> questions I have regarding beans:
[quoted text clipped - 11 lines]
> Regards,
> Francois


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.