Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes EJB and other Java EE Technologies and the fly likes Pasing Java object between client (Applet) and EJB Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Pasing Java object between client (Applet) and EJB" Watch "Pasing Java object between client (Applet) and EJB" New topic
Author

Pasing Java object between client (Applet) and EJB

Amie Alousis
Greenhorn

Joined: Mar 20, 2001
Posts: 4
We need to have a java object ( a javabean) that shuld be passed between client(applet)
and ejb with good abstraction and perfomance..
What r the pros and cons in the following two designs
Inheriting Java Object:
By Inheriting the Java Object from the entity bean, the client will get the java object
thru remote interface..
Here the attributes of java object shuld be public..
Using Ejb2.0:
setting values of the entitybean attributes using abstract set and get methods of
ejb2.0 specification. Here we have attributes of java object as private.

The Entity bean has the following methods..
abstract public void setId(java.lang.String val);
abstract public java.lang.String getId();
abstract public java.lang.String getNumber();
abstract public void setNumber(java.lang.String val);
abstract public void setName(java.lang.String val);
abstract public java.lang.String getName();

public String ejbCreate(DetailBean bean) throws CreateException
{
log("ejbCreate( )");
setId(bean.getId());
setName(bean.getName());
setNumber(bean.getNumber());
return null;
}
public void setJavaObject(DetailBean bean)
{
setName(bean.getName());
setNumber(bean.getNumber());
}
public DetailBean getJavaObject()
{
DetailBean det = new DetailBean();
det.setName(getName());
det.setNumber(getNumber());
return det;
}

Any help will be highly appreciated..
Thanks
Amie
 
Don't get me started about those stupid light bulbs.
 
subject: Pasing Java object between client (Applet) and EJB
 
Similar Threads
JNDI not found for local entity beans in RI server
EJB does not update table
entity bean primary key error
some problem with Entity Bean with PK
try to solve cmp exception over weblogic8.1