Forums Register Login

Home Interface and Remote Interface

+Pie Number of slices to send: Send
I've come across Home and Remote Interfaces in the EJB specs. COuld someone explain what is the significance of this ?
Deepak
+Pie Number of slices to send: Send
By Definition Home Interface defines a bean's lifecycle method which include methods for creating new beans,finding beans & removing beans. Remote interface defines the bean's business methods.
Let's take an example now.
An office can have many departments.So in your database you can define a table named department and you can have a corresponding
Entity bean defined as 'Department'(which is nothing but a view of your table).
Now to add a new department in the office you have to use the create() method of home interface of the 'department' Entity bean.Similarly to remove a department from office you can use the remove() method of the home interface.So the syntax will be like: Instance of your Home Interface.create() ;
Instance of your Home Interface.remove() ;
Now the department table can have many fields defined like dept. no., dept name,employees no. etc.
You may want to know which employees work for a dept or you would like to change some of the field values defined in the department table, you can use Remote Interface Methods like get<Employee_Name>() or set<Employee_id>() methods (which you can define for each field of department table).So the syntax will be like:
Instance of your Remote Interface.getEmployeeName() ;
Hope this helps.


------------------
Those who dance are thought mad by those who hear not the music. This tiny ad plays the bagpipes:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com


reply
reply
This thread has been viewed 910 times.
Similar Threads
stateful bean with weblogic8.1
Starting problem
Exam Questions: Design Patterns used with EJB
Running SQL in an EJB
Transaction attribure For complete BEAN !!! help needed!
More...

All times above are in ranch (not your local) time.
The current ranch time is
Mar 28, 2024 03:35:01.