AppletTalk.com Forum Index AppletTalk.com
Java discussions newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Programming to interfaces with beans?

 
Post new topic   Reply to topic    AppletTalk.com Forum Index -> comp.lang.java
View previous topic :: View next topic  
Author Message
l-EE
Guest





PostPosted: Wed Apr 18, 2007 12:28 am    Post subject: Programming to interfaces with beans? Reply with 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...
Back to top
Edward Diener
Guest





PostPosted: Wed Apr 25, 2007 5:13 am    Post subject: Re: Programming to interfaces with beans? Reply with quote



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.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AppletTalk.com Forum Index -> comp.lang.java All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.