An AOP framework for Web application Dynamic Data internationalization based on Java EE architecture

Source: Internet
Author: User
Keywords Java EE Dynamic Data internationalization framework
Tags access application applied based business business logic code communication

The scheme has been successfully applied, which can realize the standard and efficient internationalization software development, and reduce the time and effort needed for software development.

The development of Internet has promoted the communication of the whole world, it needs to develop the WEB application that satisfies the requirements of different regions ' language, culture and living habits, therefore, the internationalization of software has become the problem that must be solved. At home and abroad, there are some deficiencies in the internationalization method:

Existing Dynamic Data internationalization solutions are not easy to migrate and reuse. There is no out-of-the-box Dynamic Data internationalization solution or framework.

To solve the above problems, we need to propose a solution of dynamic data internationalization.

In order to standardize and efficiently build internationalized WEB applications in a short time, it is necessary to design an internationalized http://www.aliyun.com/zixun/aggregation/13435.html "> Development framework that is easy to understand and maintain." The purpose of this paper is to extract the common operations related to internationalization, and to generate a framework of WEB application internationalization based on Spring lightweight framework, which simplifies the realization of system internationalization.

The goals are:

Make the internationalization framework available to relational databases or object relational databases. The internationalization-related common operations are extracted to the aspect (Aspect), so that programmers can focus on the core business logic to write, do not need to consider a specific country \ language environment, simplifying development. The new framework is easy to configure. The code of the framework can be reused, which can effectively improve the system development efficiency.

Design and implementation of Dynamic Data internationalization framework model

Overall design

This framework is based on the Java EE three-tier architecture (UI layer, logical layer, and persistence layer), as shown in Figure 1. All levels should follow the Unicode guidelines, that is, the internal coding using Unicode standards, b/s architecture recommended the use of UTF-8 coding.

Figure 1. The general logic framework of internationalization based on B/s

Figure 2. Dynamic Data Internationalization Framework Design

This container is composed of 3 parts that are internationally configured annotations, DAO layer resource processors, and functions that act as filter roles and implement internationalized public enhancements.

In this container, the internationalized Aspect, which is mainly based on the annotation label of the entity Bean, determines which resource is accessed and which resource processor is used for processing.

In the container, the DAO layer's resource processor, which accesses resources by accessing and accessing the resources, mainly based on the configuration information in the entity Bean annotations.

Layered structure is based on B/s architecture of Java EE application Standard Model, this framework by dividing the application hierarchy, you can get each layer clear functions and responsibilities, simplifying the implementation of the code difficult.

The framework has the following advantages:

Not relying on the persistence of resources;

You can use resource files or relational databases to store information. When you use a relational database to store, you can do data access, either Tanku or a separate table.

The internationalization function and the business logic decoupling;

Programmers can focus on the core of the BO layer of business logic to write, the internationalization-related functions extracted to the aspect. No need to consider international specific country \ Language, just write the source code for database operations, access to the database, improve the security of access to the database.

Adhere to OOP design, supplemented by AOP design, can reduce code, control development costs, with annotations to implement one by one mapping between object relational database.

It manages the Java class to the database table mapping, in the JavaBean only then embeds the annotation label, the internationalization related code completely extracts to the annotation implementation Bean, JavaBean does not use the internationalization correlation code completely, facilitates the reuse and the debugging.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.