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 / July 2003

Tip: Looking for answers? Try searching our database.

To bean or not to bean....

Thread view: 
Benjamin Stewart - 30 Jun 2003 01:32 GMT
Greetings,
We are currently developing an applicaton that we are implementing using
 java and struts. In the future we may migrate this application to
another type of UI (standalone application for example).

I am finding that I need to be bean compliant to use within struts,
which is fine. I have done some reading about beans, and I am unable to
find out what we do with the following issues;

1. Constructors that take parameters, does beans allow this in anyway at
all, how do I get the same functionality.

2. Methods that validate something (one of our functons isProductValid()
is an example).

3. Static methods, we run a number of these and not sure how beans will
behave with me trying to execute a static method.

I have been told that in a classic sense if I am going to use set/get i
am actually setting or getting a particular private attribute within the
class, do I need to change the way I think about set/get with reference
to java beans ?

Like I say, I have done google search for this stuff, but not able to
find anything specific, if there are sites out there that cover this
stuff, please point me in the right direction.

Thanks for your help/suggestions.

Ben
Shantanu Banerjee - 19 Jul 2003 03:05 GMT
: Greetings,
: We are currently developing an applicaton that we are implementing using
:   java and struts. In the future we may migrate this application to
: another type of UI (standalone application for example).

: I am finding that I need to be bean compliant to use within struts,
: which is fine. I have done some reading about beans, and I am unable to
: find out what we do with the following issues;

: 1. Constructors that take parameters, does beans allow this in anyway at
: all, how do I get the same functionality.

watch out for  "extra-linguistic" constructors as these are not ( as opposed
to default constructors) invoked upon de-serialisation.

: 2. Methods that validate something (one of our functons isProductValid()
: is an example).

 all "is"-type methods  must return > boolean <

: 3. Static methods, we run a number of these and not sure how beans will
: behave with me trying to execute a static method.

fine

: I have been told that in a classic sense if I am going to use set/get i
: am actually setting or getting a particular private attribute within the
: class, do I need to change the way I think about set/get with reference
: to java beans ?

set / get type properties are automatically available i.e. extractable
(e.x. to a GUI builder application that glues together such beans )
alone by virtue of this naming convention, which thus is quasi mandatory.
Such properties then, in this sense, represent the interface this here
bean presents to the outside world, and as such is not his private parts.

: Like I say, I have done google search for this stuff, but not able to
: find anything specific, if there are sites out there that cover this
: stuff, please point me in the right direction.

Web developer,s guide to java beans by Jalal Feghhi
is a good book ( amonst many others)

: Thanks for your help/suggestions.

cheers
: Ben


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.