Help | Site Map
Connecting Tech Pros Worldwide
 
 
LinkBack Thread Tools
  #1  
Old April 17th, 2007, 08:35 PM
l-EE
Guest
 
Posts: n/a
Default Programming to interfaces with beans?

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...


  #2  
Old April 25th, 2007, 01:15 AM
Edward Diener
Guest
 
Posts: n/a
Default Re: Programming to interfaces with beans?

l-EE wrote:
Quote:
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.
 

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over network members.
Post your question now . . .
It's fast and it's free

Popular Articles