APPFUSE Overview

xiaoxiao2021-03-06  36

APPFUSE Overview

Application FUSE, Application Fuse, is like a glue, which will develop the parts of the APPLICATION level (web layer, Logic layer, and Persistence layer) to form an application template and prototype. The techniques and frames involved include the Hibernate, Logic layers of the Persistence, SpringFramework, web layer Struts (webwork ..), using the main XDoclet and Ant, there are also many Framework for the test (individuals don't like very much , Feel the test or the integrated JUnit test feet provided by IDE, so there is no too much study). The following text will try to make more comprehensive analysis of AppFuse.

A. Application architecture provided by .Appfuse. AppFuse provides a set of Templet Code from Persistence to Web that lays the application's architecture, which will be set forth in the order from Persistence to JSP.

In this level of Persistence, AppFuse first provides a very abstract interface DAO, attempting to override usually CRUD operations, provided by Opect, accompanied by this interface, also provides a Hibernate version of Implement ( Basedaohibernate). This very abstract interface has any practical role. It is clear in Appfuse's API: To Hold Common Methods That The Might All Use. Can be used for standard crud Operations. But in the specific application, the opportunity I have to use is not a lot (maybe you have to complete a common module that is equally abstract, may be used), because we provide it based on the DAO written according to the needs of Application. The same function is a CRUD operation for the specific type of business object. This level appfuse recommended Framework is Hibernate, of course, we can fully provide other import, such as iBatis, or simply jdbc, such as iBatis, or simply jdbc, and personal and winter is not very easy to use, though I really like the more OO architecture brought by ORM, but I look at the short line of code hibernate, I have done a number of things behind, and I am still a bit mystery.

2. The weight problem that needs to be solved at this level of Logic layer is a matter of transaction. You can act a lot of technologies in this level, such as the session bean in EJB, but AppFuse has selected SpringFramework, what is the advantages and disadvantages of these two technologies, nothing Discussion, personal thinkion beans are also good.

AppFuse also provides an interface, Manager, which is similar to a giant abstraction like the Persistence layer, with this interface, and provides a specific IMPLEMENTION BASEMANAGER, with this abstract interface manager, in front of Interface Dao I have already mentioned that there is not much mention of SpringFramwork.

3. Web layer This level AppFuse integrates several currently common Framework, Struts is the preferred option, APPFUSE provides a baseAction, which provides some convenient ways, such as from Spring's ApplicationContext to get XXXManager according to XXXManager according to XXXManager, Get the current user information from Session, and the processing of ErrrorMessage, need to mention the execute method, according to the method in Request, the parameter to the corresponding dispatch to the corresponding handler, specific details Refer to LOOKUPDISPATCHACTION in Struts ( This Class seems to be from Struts-1.1).

This level also provides a Baseform as a Base FormBean, providing some convenience of higher abstract hierarchies, such as Equals and basic validation. This level appfuse also provides two business-related JSP Templet, one is a business object Form page, one is a business object list page. Business object Form is a business object to complete new, modify, delete and other operations. The technologies involved in this page mainly include JSTL and Struts's form taglib. These two technologies don't talk about it. It is necessary to mention a Label Tag provided by AppFuse. This TAG can be based on our in Validation to Formbean Validation configuration determines whether the * is displayed (indicating that you must fill it). Business object List is a batch of business objects to complete the ordering. The techniques involved in this page mainly have Display Tag, a very nice taglib. AppFuse takes into account the performance and content of the JSP page, introduced a SiteMesh as a framework for the entire page, which is an Open source Framework, the main method is to define a Decorator page, and then equipped with a Filter to Decorator Our

Business page.

AppFuse also introduces Struts-Menu at this level, which is a nice open source taglib for processing Menu, and AppFuse uses struts-menu to configure the static XML, we may have to be more flexible (maybe It is the manifest according to the permissions of the user, and will be mentioned later. AppFuse also provides centralized processing of Error and Message.

II .Appfuse also provides us with a default application module such as User Manager. This module is mainly done to manage Role, User in Application, and the processing of login, logout, cookie, which is binding with Tomcat technology, and the business model is simple, so you can consider this block. There is still a lot of things in things, but there are still many things worth reference.

3. How to apply the AppFUSE development business. AppFuse gives us a complete architecture, we only need to pack it into this architecture, which is probably how to use AppFuse to conduct actual business development.

As the author of AppFuse is recommended in Wiki, we can develop in order from the back forward.

1. Analyze business model to establish model

2. Establish DAO

3. Establish Manage

4. Develop ACTION and PAGE

The AppFuse provides an Appgen code generation tool to use the XDoclet to automatically generate the code of all levels according to the XDoclet, which is powerful and everywhere in the XDoclet, according to the AppFuse. TempleT Code.

However, the generated winter and winter can only be used, and there must be modifications, and some winter and winter are unable to generate, for example, in the userform.jsp Processing for Country and Role, because Not simple Input, Template It's stupid, so I can only provide a reference, appgen is nothing more than letting you knock less, but it is still different from 0 starting and modifying workload on the generated code.

IV. Real Using AppFUSE Issues.

1. Chinese issues APPFUSE uses UTF-8 coding to solve internationalization problems, and it is really a very thorough way to completely have internationalization, but pay attention to it, if you use mysql, you need to change the mysql jdbc URL ,

ConnectionURL = "JDBC: mysql: // localhost / test? Autoreconnect = true & usefulode = true & characterencoding = utf-8"

Need to change

ConnectionURL = "JDBC: mysql: // localhost / test? Autoreconnect = true & useunicode = true & characterencoding = GB2312

This is actually MySQL problem, with the APPFUSE no direct relationship, and there is no Chinese coding problem in Oracle. 2.ant ​​scripting appfuse provides a lot of Ant Target for providing various purposes. In fact, many Targets can be perGute once at the establishment of the environment. If you can implement negative effects during project development, such as database operations of

Target runs can be very dangerous, and no Target is provided in the IDEA, each time you need an Execute to find a Target to find a half-day, so personal feelings need to streamline the appfuse script.

Just intended to use AppFuse, so a rough analysis is made, there may be some places to understand, it is not very deep, and the right to throw bricks and jade. I hope everyone will study more.

转载请注明原文地址:https://www.9cbs.com/read-70510.html

New Post(0)