What are the factors that will decide on remote access or local access of an enterprise bean?
Answered
What are the factors that will decide on remote access or local access of an enterprise bean?
Best answer
The factors that will help to decide on local or remote access are:
-
- Tight or loose coupling of related beans : Tightly coupled beans depend on one another. Tightly coupled beans are good candidates for local access. Because they fit together as a logical unit, they typically call each other often and would benefit from the increased performance that is possible with local access.
-
- Type of client : If an enterprise bean is accessed by application clients (Java SE clients), it should allow remote access. If an enterprise bean’s clients are web components or other enterprise beans (Java EE clients), the type of access depends on how you want to distribute your components.
-
- Component distribution : Java EE applications are scalable because their server-side components can be distributed across multiple machines. In distributed scenario, the enterprise beans should allow remote access.
-
- Performance : Owing to such factors as network latency, remote calls may be slower than local calls. On the other hand, if you distribute components among different servers, you may improve the application’s overall performance. Both of these statements are generalizations; performance can vary in different operational environments.
If you aren’t sure which type of access an enterprise bean should have, go for remote access. This decision gives you more flexibility. Although it is uncommon, it is possible for an enterprise bean to allow both remote and local access.