0

I am trying to understand the implementation difference between creating a local or remote interface for my stateless session bean however I see various solutions and am wondering if there is a certain "standard" or general "preference".

For local interface, I can create everything (servlets, session bean, jsp) within a Java EE Enterprise Application project.

For remote interface, do I need to create the remote interface in a Java Class Library or Java Application or Java Web Application? Then the remaining code is within a Java EE Enterprise Application project...

Also, what is the reason for creating a session bean in a Java EE Enterprise Application Project instead of a Java Web Application Project?

Thank you!

jasmine
  • 361
  • 1
  • 3
  • 11

1 Answers1

0

I am trying to understand the implementation difference between creating a local or remote interface for my stateless session bean however I see various solutions and am wondering if there is a certain "standard" or general "preference".

The main difference is that remote interface are coarse grained and the call is by value. While local interface are fine grained and the call is by reference.

For remote interface, do I need to create the remote interface in a Java Class Library or Java Application or Java Web Application? Then the remaining code is within a Java EE Enterprise Application project...

if you have a remote interface, it has to be packed in a separate .jar file. The .jar file has then to be included as a dependency in your main project (on the application server) and distributed to your remote client.

Also, what is the reason for creating a session bean in a Java EE Enterprise Application Project instead of a Java Web Application Project?

Since ejb 3.1 specification, an ejb can be packed directly in a .war file. In the old J2EE days an ejb could only be packed in a .jar to be included in a .ear file.

Leonardo
  • 9,607
  • 17
  • 49
  • 89