Seven, MVC Web Framework
Spring MVC Model is similar to Struts. At this multi-threaded service object, Spring's Controller is similar to Struts Action, and only one instance processes all customer requests.
Spring MVC is the advantage of struts:
1, Spring provides a very clear partition in Controller, JavaBean, Model and Views;
2, Spring's MVC is very flexible. Unlike struts to force you to inherit its Action and FORM objects, Spring MVC is completely interface-based;
3, Spring MVC is true for real View. You will not be enforced using JSP
4. Like other objects, Spring Controller is configured through IOC. Make them easy to test;
5, the web layer has become a thin layer on the business object layer
Eight, EJB related
Implement EJB:
If you choose to use EJB, Spring can provide a lot of benefits on both EJB implementations and client access EJBs.
Spring provides convenient superclars for Session Bean and Message Drive Beans, making it easy to automatically load the XML document BeanFactory included in the EJB JAR file.
It feels not very useful.
Use EJB:
Many EJB procedures use Service Locator and Business Delegate mode, which are more than a lot of jdni in customer code, but there is a significant shortcoming:
l Use the typical code of EJB to rely on Service Locator or Business Delegate Singletons, which is difficult to test;
l In the case where Business Locator mode does not use Business Delegate, the program code also returns the create () method in EJB Home, and may result in exceptions, and the code is still bound to the EJB API;
l Implementing business delegate mode usually results in significant code repetition;
We only need to define a component to the bean that needs EJB. Specify its JNDI Name, Interface, the Spring AOP framework, and the Spring AOP framework will help you create a proxy for EJB, cache EJBHOME, proxy JNDI lookup, call The business method of the response.
This makes your web layer code do not depend on EJB usage if you want to use Pojo or other Object instead of EJB reference, you only need to change the component to define XML without affecting the code.
TRACKBACK address: http://www.yculblog.com/trackbackback/0/122833