aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes why on bean why not from bean just see Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "why on bean why not from bean just see" Watch "why on bean why not from bean just see" New topic
Author

why on bean why not from bean just see

Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Dear sir i have a confusion in a topics like see.
suppose i have creatd a bean class, a component interface,a home interface. now as we know that the function which will be called remotely will be written in component interface and the code for that function will be in bean class.
now see supose the remotely method is getAdvice() so as in many book i see that this function will be called on bean. I am not getting one thing that FUNCTION WILL CALLED ON BEAN . it should be the FUNCTION WILL CALLED FROM BEAN. why on bean what does bean by this that i would like to know.

with regard

Arun kumar maalik
Jeroen T Wenting
Ranch Hand

Joined: Apr 21, 2006
Posts: 1847
This is a language question rather than an EJB question

Calling a method ON a class means you're executing that method as defined by the class.
Calling a method FROM a class means you're executing that method from another method defined in that class.

So when the container calls someBean.getAdvice() it's calling the getAdvice() method ON that bean (which is an instance of your AdviceBean class or another class the container generates from it at deploytime).

When your getAdvice() method than calls System.out.println() it's calling println() FROM the getAdvice() method and ON the object System.out refers to.


42
Arun Maalik
Ranch Hand

Joined: Oct 25, 2005
Posts: 216
Thanks sir i have understood.
 
 
subject: why on bean why not from bean just see