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 / General / April 2007

Tip: Looking for answers? Try searching our database.

Programming to interfaces with beans?

Thread view: 
l-EE - 17 Apr 2007 20:28 GMT
If I'm writting a bean - and I mean just a plain old Java Bean not an EJB or
anything like that - is there any merit to seperating the interface out of
the class? I do this with pretty much every other kind of class I write but
Beans...
Edward Diener - 25 Apr 2007 01:13 GMT
> If I'm writting a bean - and I mean just a plain old Java Bean not an EJB or
> anything like that - is there any merit to seperating the interface out of
> the class? I do this with pretty much every other kind of class I write but
> Beans...

Just like any class, if you separate out the interface you can have
other developers implement the interface in order to extend your
JavaBean ideas. Of course you might also want to provide an empty
implementation of the interface as a convenience class of those who just
want to extend the interface with just a subset of changes from the default.

Another advantage of separating out an interface, as a common idea, is
that you can have collections of the interface quite easily, and this
sort of collection will extend to other developers building JavaBeans
from your interface.


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.