× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



I do have one last question I forgot to ask and that's when to call a class a bean. For example I will use the Customer.class again. It contains an Address.class which basically just has address lines, city, state, zip and country and getters and setters for each. Should this be named AddressBean and since the customer is just customer information with getters and setters should it be CustomerBean?

For years I didn't see the point of complying with bean conventions with my code.

Finally the light bulb light up when I started using tools which could read my classes if they were bean compliant.

Bean conventions don't have anything to do with calling it a Bean. The "bean" aspect comes into play with other programs can expose your program through reflection and introspection. See

java.sun.com/docs/books/tutorial/reflect/index.html (reflection)
java.sun.com/docs/books/tutorial/javabeans/introspection (introspection)

Name the class whatever makes sense.

Let's see what Thorbjørn's take on this is.

Bill



-----Original Message-----
From: java400-l-bounces@xxxxxxxxxxxx [mailto:java400-l-bounces@xxxxxxxxxxxx] On Behalf Of James Perkins
Sent: Tuesday, October 21, 2008 3:26 PM
To: Java Programming on and around the iSeries / AS400
Subject: Re: Understanding Object Usage

Thorbjørn,
As always you have great advice. The interface makes more sense to me now. I
basically knew what they did and I've used them in examples, but I failed to
see the use of them in a whole. I like the contract concept though. That
makes a lot of sense.

As far as the comments go. They make a lot of sense too. I was struggling on
the concept of creating too many objects vs. creating the objects needed.
And just an FYI I'm not really migrating anything, just trying to learn is
all.

I do have one last question I forgot to ask and that's when to call a class
a bean. For example I will use the Customer.class again. It contains an
Address.class which basically just has address lines, city, state, zip and
country and getters and setters for each. Should this be named AddressBean
and since the customer is just customer information with getters and setters
should it be CustomerBean?

I just want to stick to some standards and not write a bunch of sloppy code
that makes sense to no one except me.

Thanks in advance,
James R. Perkins

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.