Hi, i have a doubt when we write a Home Interface we call a create() method whic returns an EJBObject. But return type of create() is RemoteInterface WHY?? as in below example which is a HomeInterface why return type is RemoteInterface
Well because your created EJBObject is implementation of Remote interface
Originally posted by Anurag M: Hi, i have a doubt when we write a Home Interface we call a create() method whic returns an EJBObject. But return type of create() is RemoteInterface WHY?? as in below example which is a HomeInterface why return type is RemoteInterface
Thanks
Vikas Sharma
SCJP(1.4)
Anurag Mishra
Ranch Hand
Joined: Jun 16, 2003
Posts: 121
posted
0
Can u pls tell me in Detail so that i can Understand.. thanks in advance.....
"Anurag M", I'm sorry that I missed it in the previous thread but your display name still doesn't comply. The naming policy allows initials only for first name, not last name. We'd really appreciate it if you could change it (again). Thanks, and sorry for the hassle.
Anurag, the bean implementation class that the EJB container generates based on the implementation class you wrote implements the remote interface you wrote. The client is only interested in having access to an object providing that "business" interface, he's not interested in having an EJBObject. That's why the home interface's create methods' signatures return the remote interface.
vikasids sharma
Ranch Hand
Joined: Aug 01, 2003
Posts: 157
posted
0
Lasse Can we say other way.. As the Implementation class for EJBObject is generated by Container glue tools automatically .Client is concerned with the Interface(Remote) only that he has created as its implemetation is vendor specific. That's why the home interface's create methods' signatures return the remote interface
Originally posted by Lasse Koskela: Anurag, the bean implementation class that the EJB container generates based on the implementation class you wrote implements the remote interface you wrote. The client is only interested in having access to an object providing that "business" interface, he's not interested in having an EJBObject. That's why the home interface's create methods' signatures return the remote interface.
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
5
posted
0
Yes. Or even more compact: "The client is interested in the interface, not the implementation."
Anurag Mishra
Ranch Hand
Joined: Jun 16, 2003
Posts: 121
posted
0
thanks a lot vikasids and Lasse for ur message. i understood the point.
"Anurag", Sorry to pester you, but your display name is still not valid and this is one of few rules we are strict about. Your display name must be two words, your first name, a space, then your last name. It should be your real name. Check the Naming Policy page if you need more information. thanks, Dave.