aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes Can these methods exist... Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Can these methods exist..." Watch "Can these methods exist..." New topic
Author

Can these methods exist...

Yogesh Mathur
Greenhorn

Joined: Apr 18, 2002
Posts: 17
Hi!
I have a very fundamental doubt.
Can we have a method definition in our Bean's Implementation class without declaring it in the Remote Interface & Home Interface. If yes, that means our Bean Class will have this method, but clients won't have access to this method, indeed makeing it a useless method (or, is it usefull in some cases?)
Please Clarify...
Thanks in advance..


Yogesh
Pradeep bhatt
Ranch Hand

Joined: Feb 27, 2002
Posts: 8919

Yes, u can have a method in the bean class and not have it declare it in the remote i/f..this mean the client cannot use that method..but that method may be called from any other business method..which the client can access throught remote i/f ..If some method is useless why would any one define that method in first place?

Originally posted by Yogesh Mathur:
Hi!
I have a very fundamental doubt.
Can we have a method definition in our Bean's Implementation class without declaring it in the Remote Interface & Home Interface. If yes, that means our Bean Class will have this method, but clients won't have access to this method, indeed makeing it a useless method (or, is it usefull in some cases?)
Please Clarify...
Thanks in advance..


Groovy
Gagan Indus
Ranch Hand

Joined: Feb 28, 2001
Posts: 346
I guess , yes
no harm in having such a method but it dont necessarily have to be useless
it can be a private method or some sort of 'utility'method. If there is some functionality common to more than one methods which u r exposing through interfaces , then that functionality can be kept in such a utility method.
just 1.5 cents of mine


Gagan (/^_^\) SCJP2 SCWCD IBM486 <br />Die-hard JavaMonk -- little Java a day, keeps you going.<br /><a href="http://www.objectfirst.com/blog" target="_blank" rel="nofollow">My Blog</a>
Marcos Maia
Ranch Hand

Joined: Jan 06, 2001
Posts: 977
Hi, yes you can have such method. A commom use of doing so is to have a method who performs some kind of log service, and the clients doesn�t have to know about it.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Can these methods exist...