The following diagram shows the architecture of a typical J2EE application. This is similar to the previous example,except all business logic is contained in different EJB components.


EJB web application





The diagram below shows how the JSP connects to the EJB object,which queries the database. This was the JSP does not contain the database queries and some business logic has been moved into the EJB layer. The EJB container is designed to create copies (instances) of the EJB class as required in memory. This enables it to scale up as multiple requests come in.



EJB Components





Advantages.





  • More secure because all the business logic is stored in the EJB components. An EJB component can be configured so only a specific user in a group can be given access to a limited set of methods.


  • By adding more EJB Application Servers,the system can easily scale up. However,you need to make sure the EJB components have been designed and deployed correctly.

  • Transaction Management support - Transaction attributes are specified on an application component during assembly. This lets you group methods into transactions across application components,which means you can easily change application components within a J2EE application and reassign the transaction attributes without changing code and recompiling.



Disadvantages.




  • All the JSP pages need to include code that locates the EJB components. 



  • There is still quite a bit of functionality in the JSP files.



  • The current architecture does not support reuse at the JSP level so all the code will need to be replicated. This will cause major maintenance problems.



  • The JSP pages are still too complex for web designers to use.


                    

Copyright © 2013 VisualBuilder. All rights reserved