java ee - EJB - Reason for home and remote interfaces -


i new java ee , not getting interfaces parts of ejb. throw light on why need 2 interfaces(home , remote) session bean? is'nt 1 interface suffice call remote ejb in rmi?

a home factory ejb references. in ejb 3.0+, replacement homes uses jndi factory. there advantages using homes:

  1. the overhead of jndi context.lookup (or ejbcontext.lookup) higher overhead of home.create(). if need create many ejb references (e.g., stateful session beans), overhead might noticeable. possible overheads of both approaches low enough not matter application.
  2. homes allow arguments passed when creating stateful session bean. there no direct equivalent when using jndi, must have (and remember use) initialize method or similar.
  3. ejbhome has getejbmetadata can used introspect ejb. metadata important generic frameworks due corba requirement of using portableremoteobject.narrow (i.e., home lookup string, can obtain home, narrow ejbhome, reflectively call create, call getejbmeta().getremoteinterfaceclass(), , narrow target type). there no equivalent jndi, isn't necessary since ejb 3 remote interfaces not need depend on rmi(-iiop).

i wish generic javax.ejb.ejbfactory<t> interface existed ejb 3 interfaces solve of these problems.


Comments

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -