This week's book giveaway is in the OO, Patterns, UML and Refactoring forum. We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line! See this thread for details.
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.
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.