GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

GeekInterview.com  >  Interview Questions  >  J2EE  >  EJB
Go To First  |  Previous Question  |  Next Question 
 EJB  |  Question 20 of 175    Print  
What is the difference between local interface and remote interface

  
Total Answers and Comments: 1 Last Update: October 23, 2005   
  
 Sponsored Links

 
 Best Rated Answer

No best answer available. Please pick the good answer available or submit your answer.
May 03, 2005 19:07:16   #1  
John        

RE: What is the difference between local interface and remote interface
We can describe the following common rules for choosing whether to use remote client view or local client view: 
 
When you will potentially use a distributed environment (if your enterprise bean should be independent of its deployment place), you should obviously choose remote client view. 
 
Use remote client view when you need to be sure that parameters passed between your EJB and the client (and/or other enterprise beans) should be passed "by value" instead of "by reference." With pass-by-value, the bean will have its own copy of the data, completely separated from the copy of the data at the client. With local client view, you can do pass-by-reference, which means your bean, as well as the client, will work directly with one copy of the data. Any changes made by the bean will be seen by the client and vice versa. Pass-by-reference eliminates time/system expenses for copying data variables, which provides a performance advantage. 
 
If you create an entity bean, you need to remember that it is usually used with a local client view. If your entity bean needs to provide access to a client outside of the existing JVM (i.e., a remote client), you typically use a session bean with a remote client view. This is the so-called Session Facade pattern, the goal of which is that the session bean provides the remote client access to the entity bean. 
 
If you want to use container-managed relationship (CMR) in your enterprise bean, you must expose local interfaces, and thus use local client view. This is mentioned in the EJB specification. 
 
Enterprise beans that are tightly coupled logically are good candidates for using local client view. In other words, if one enterprise bean is always associated with another, it is perfectly appropriate to co-locate them (i.e., deploy them both in one JVM) and organize them through a local interface.

 
Is this answer useful? Yes | NoAnswer is useful 0   Answer is not useful 1Overall Rating: -1    

 Related Questions

Latest Answer : An EJB object is also an java object, but as it follows the EJB Specifications, it can be remotely identified in an Application server. An java object can be deployed in an application server, but cannot be idetified. i.e A java object can be in the classpath ...

Answer posted by Mohan on 2005-05-20 08:40:04: Java Beans is intra-process component where as EJB is an Inter-Process component  JavaBeans is particularly well-suited for asynchronous, intra-application 
Latest Answer : JavaBean :1. Low-level approach for developing re-usable components for building different Java applications (Applets, stand-alone applications etc.).2. Java Beans runs in a JVM, just like other normal java classEJB :1. High-level approach to build Distributed ...

Answer posted by Mohan on 2005-05-20 08:45:36: Stateful session beans have the passivated and Active state which the Stateless bean does not have. 
Latest Answer : Stateful session beans follow the instance passivation techniqueStateless session beans follow the instance pooling technique.ejbActivate() and ejbPassivate() methods are not called in Stateless session beansI ...

Answered by Jey on 2005-05-08 11:32:16: CMP means Container Managed Persistence. When we write CMP bean , we dont need to write any JDBC code to connect to Database. The container will take care of connection 
Latest Answer : CMP means Container Managed Persistence. In case of CMP bean , developers dont need to write any JDBC code to connect to Database. The container will take care of connection our enitty beans fields with database. The Container manages the persistence ...

Answered by Jey on 2005-05-08 12:51:03: EJB 2.0 adds the local beans, which are accessible only from within the JVM where beans are running in.  In EJB 1.1, we had to implement remote client 
Latest Answer : EJB 2.0 came with new features which not available in EJB1.1 they are auto primarykey generation,EJB-query language,local interfaces,relationships. ...

Answered by Jey on 2005-05-08 12:30:37: Message Driven Bean (MDB) is an enterprise bean which runs inside the EJB container and it acts as Listener for the JMS asynchronous message . It does not have Home 
Latest Answer : Message Driven Bean (MDB) is an enterprise bean which runs inside the EJB container and it acts as Listener for the JMS asynchronous message . It does not have Home and Remote interface as Session or Entity bean. It is called by container when container ...

Answered by Jey on 2005-05-08 12:33:35: If Client and EJB classes are in the same machine ( Same JVM) then we can use Local linterface instead of Remote interface. Since Client and EJB are in same JVM, 
Latest Answer : Local interface is when the client and the ejb are colocated in a same jvm.Here the client is another EJB.In case of Local interface there is no need of throwing RemoteException rather it throws EJB Exception which is a subclass of Runtime Exception.so ...

Latest Answer : We can describe the following common rules for choosing whether to use remote client view or local client view:  When you will potentially use a distributed environment (if your enterprise bean should be independent of its deployment place), ...

Answered by Jey on 2005-05-08 11:55:29: Activation and Passivation is appilicable for only Stateful session bean and Entity bean.   When Bean instance is not used for a while by client then EJB 
Latest Answer : Activation and Passivation is appilicable for only Stateful session bean and Entity bean.   When Bean instance is not used for a while by client then EJB Container removes it from memory and puts it in secondary storage (often disk) so that ...

Latest Answer : Session Bean comes with the implicit services where as HHTPSession does not.   Session Bean can be web based or can be stand alone where the other can only be web based.  Session Bean can be used for multiple operation for a single ...


 Sponsored Links

 
Related Articles

High-Speed Serial Interface (HSSI)

High Speed Serial Interface HSSI HSSI is High Speed Serial Interface was first developed by Cisco systems and the main purpose was to solve high speed requirement issues The main application of HSSI is on the Wide Area Networks and it helps to enhance the data flow speed on these networks It can wor
 

Fiber Distributed Data Interface (FDDI)

Fiber Distributed Data Interface FDDI The Fiber Distributed data interface or the FDDI is a 100 mbps line using the LAN network and is connected through a fiber optic cable The FDDI technology is used where the networks need a high speed bandwidth and need to cover huge distances than the copper wir
 

What is difference between call by value and call by reference in function?

The arguments passed to function can be of two types 1. Values passed 2. Address passed The first type refers to call by value and the second type refers to call by reference. For instance consider program1 main() { int x=50, y=70; interchange(x,y); printf(“x=%d y=%d”,x,
 

The Interview Snafu

How to turn someone else’s mistake to your advantage Your dream job is about to become reality. A recruiter gave you the heads up about the perfect position at Humungous Conglomerate, Inc. You went through five interviews as well as a battery of psychological tests mandated by their HR de
 

Winning a Job Interview with a Winning Resume

Does your resume unlock your potential, take your skills to the highest level and win you the interview and the job you want now? The job market today is highly competitive and even if you think you have what it takes to get an interview you won’t get over the line without a polished, prof
 

XML Remote Calling Procedure

XML Remote Calling Procedure XML RPC or the XML Remote Calling Procedure is a set of compilations and implementations which allow certain programs to run on complex platforms or operating systems and allows them to make Remote Procedure calls on the Internet The Remote Procedure Calling Protocol use
 

Importance of Proper English during Job Interview

Importance of Proper English during Job Interview Your job interview is crucially important and it will determine whether or not you will get the job Depending on the type of job you re going for it is very important for you to use proper English In most cases jobs which offer higher salaries will h
 

Difference between Scholarship and Grant

Difference between Scholarship and Grant While both scholarships and grants allow students to pay for their tuition without having to pay the money back there are a number of key differences between the two Knowing the difference between grants and scholarship will make it much easier for students t
 

HR Interview - HR Interview Mistakes You Will Want To Avoid

HR Interview Mistakes You Will Want To Avoid The job interview can be a stressful process This is especially true for those who are going after a competitive position Your nonverbal communication combined with the answers you give during the interview will determine if you are hired mosgoogle While
 

HR Interview - Behavioral HR Interviews

Behavioral HR Interviews As the name implies a behavioral interview is an interview that is held by a human resources department to determine if an applicant has the behaviors that are appropriate for a job The company must know how an applicant will behave in a certain situations mosgoogle The logi
 





About Us  |   Privacy Policy  |   Terms and Conditions  |   Contact  |   Site Map  |   Add Question  |   Propose Category  |   RSS Feeds  |   Articles Sitemap  |   Site Updates  |   Add Resource

Copyright © 2005 - 2008 GeekInterview.com. All Rights Reserved
Page copy protected against web site content infringement by Copyscape