Modular Engineering Construction Series (2)

The main application technologies of block development:

1. Front-end resource dependency management: Use  webjars  to manage module front-end resources through Maven;

Introduction to WebJars

The web front end uses more and more JS or CSS like jQuery, Backbone.js and Bootstrap. In general, we copy these Web resources to the corresponding directory of the webapp of the Java Web project for management. This kind of manual management may cause version errors, copy version errors, missing copies, etc., resulting in incorrect display of front-end pages, inconsistent versions, and cluttered files, resulting in some inexplicable errors.

WebJars is to package web front-end resources (js, css, etc.) into jar package files, and then use the Maven tool to perform unified dependency management on web front-end resources in the form of jar packages to ensure the uniqueness of these web resource versions. The jar packages of WebJars are deployed on the Maven central repository.

2. Server-side dependency management: Maven is used to publish modules and introduce dependent modules.

3. Application module dependency structure diagram:

 Note: Each module is divided into two parts: the server jar and the front-end resource jar. Each part can be released through Maven, and the business module can dynamically update the dependent modules by modifying the version number.

 

Module development notes:

   1) Depends on the reference of the front-end resources of the module (how to solve the problem involving multiple versions of the same resource?);

   2) How does the dependent module provide the function expansion of the upper-level module (typical problem: the login service of the system module, the user will cache the user information after logging in, this user information is relatively simple, how does the business module extend the user's business attributes?);

   3) Interface description of multiple versions of the module (you can use swagger2 to define each version).

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325137026&siteId=291194637