CN111143451A - SSM framework design method for hierarchical architecture design - Google Patents
SSM framework design method for hierarchical architecture design Download PDFInfo
- Publication number
- CN111143451A CN111143451A CN201911290775.6A CN201911290775A CN111143451A CN 111143451 A CN111143451 A CN 111143451A CN 201911290775 A CN201911290775 A CN 201911290775A CN 111143451 A CN111143451 A CN 111143451A
- Authority
- CN
- China
- Prior art keywords
- class
- service
- entity
- controller
- data
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/20—Information retrieval; Database structures therefor; File system structures therefor of structured data, e.g. relational data
- G06F16/25—Integrating or interfacing systems involving database management systems
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/958—Organisation or management of web site content, e.g. publishing, maintaining pages or automatic linking
Landscapes
- Engineering & Computer Science (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Stored Programmes (AREA)
Abstract
The invention provides an SSM framework design method for hierarchical architecture design, which is based on an SSM framework widely applied, provides a method for realizing the classes or interfaces of IOC, MVC and ORM for information management objects, creates a series of entity classes, mapping classes, service classes, control classes and views of hierarchical design, can realize informatization management of a standard system, and is convenient for query use and update management; the service logic, the data and the interface are separated through a layered design mechanism, the coupling degree of codes is reduced, and the maintainability and the expansibility of the system are greatly improved.
Description
Technical Field
The invention relates to the technical field of SSM frameworks, in particular to an SSM framework design method for hierarchical framework design.
Background
The SSM framework is widely applied in information management systems at present to solve the problems of high code coupling degree, difficult expansion and maintenance. The SSM framework is formed by integrating Spring, springMVC and Mybatis. Spring is a lightweight control Inversion (IOC) and facet oriented (AOP) container framework that can greatly reduce the code coupling. Spring MVC separates the roles of controller, model objects, dispatcher, and handler objects, making them easier to customize. MyBatis is a Java-based persistent layer framework. MyBatis maps interfaces and generic Java objects to records in a database. Allowing developers to use SQL to master and tune.
However, the SSM framework only provides the basic interfaces and mechanisms of Spring, SpringMVC, and Mybatis, and does not provide a specific implementation class and a layered system for software development of the information management system. Taking information management software development as an example, most of information management is manually managed by using excel and other modes at present, query, use and update management are very inconvenient, a few information management systems do not adopt a layered architecture design, the code coupling degree is high, and when the description parameters or the display mode of a standard system are changed, the problems of difficult expansion, inconvenient maintenance and even incapability of maintenance exist, so that the development of information management by using the current ssm framework is very complicated.
Disclosure of Invention
The technical problem to be solved by the invention is to provide an SSM framework design method for hierarchical architecture design, wherein the framework has the characteristics of easy configuration and code coupling degree so as to simplify the software development process of an information management system.
In order to solve the above technical problems, the present invention provides a method for designing an SSM framework for a hierarchical architecture design. The method is based on a standard SSM framework, a series of entity classes, mapping classes, service classes, control classes and views which are designed in a layered mode are created, and the classes or interfaces of IOCs, MVCs and ORMs are achieved, so that an information management system which is convenient to maintain and easy to expand is constructed. The method comprises the following steps:
s1, decomposing the object and the incidence relation of the information management into entity information and relation information; the entity information comprises a standard system, system nodes and a standard bibliography; the relationship information includes a standard architecture and a standard architecture manifest.
S21, creating a Maven project, setting the project object model, configuring the project module, adding the resource dependency relationship between the warehouse and the project which need to be used by the project, and designating Spring and Mybatis versions and a core package;
s22, configuring Spring, data source, transaction manager, Mybatis and Mapper files in the Spring configuration file;
s23, configuring the springMVC characteristics in a configuration file of springMVC, wherein the characteristics comprise a configuration distributor, a mapping responder, a controller and a view parser;
s24, creating a global interceptor which is responsible for intercepting the URL so that the system input can be processed before being executed by the interception logic;
s3, creating a series of entity classes, mapping classes, service classes and views which conform to the SSM framework for each entity and relationship by realizing the standard system classes or interfaces of IOC, MVC and ORM;
the entity class and the mapping class are used as persistence layers to realize entity logic relation and SQL processing logic and are responsible for reading data from a database or writing data into the database;
the service class is used as a service logic layer, a user request is obtained from a controller, data is obtained from the entity class and the mapping class, service logic processing is carried out, and the processed data is fed back to the controller;
the controller is responsible for reading data from the view, sending the data to the service layer processing logic and feeding back the data after service processing to the view;
the view is a JSP page and is used for realizing data display and page interaction;
s4, the entity class, the mapping class, the service class, the controller and the view interact in an MVC mode, and the specific interaction process is as follows:
s41, the page sends a request to the controller, and the controller receives the request and calls a corresponding service class for processing;
s42, the service class interacts with the database by calling the entity class and the mapping class, and returns the result to the controller after the service class performs service processing logic;
and S43, the controller calls the JSP, view rendering is carried out on the result to display data, and finally the client side obtains a response.
Preferably, in step S21, the project module is configured by setting the artifactId, groupId and packing project information in the project object model; designating the spring version by spring version; the dependency attribute is used in dependencies to add the warehouses and resource dependencies that the project needs to use one by one.
Preferably, in step S22, setting a context to an annotation-configuration enabled annotation and setting a context to a component-scan enabled component scan in the configuration file of the spring; setting a location attribute of propertyconfigurrer to specify the location of the properties database configuration file; and setting an attribute value of sqlSessinfactory of Mybatis, and configuring a database connection pool and a Mapper file scanning position of Mybatis.
Preferably, in the step S23, in the configuration file of springMVC, the access interception class is set through the mvc: interrupts tag; adding < MVC: annotation-driver/> enabling MVC annotation; adding < mvc, default-servlet-handle/> starting a default mapping response processor; view parsing is performed on files under a jsp folder and suffixes by adding a bean of the InternalResourceViewResolver.
Preferably, in step S24, an interceptor class inheriting the handlentercaptoradapter is created, and a method in the interceptor class is rewritten to be responsible for intercepting the URL.
Compared with the prior art, the invention has the following beneficial effects:
the invention provides a method for realizing the classes or interfaces of IOC, MVC and ORM for information management objects based on a widely applied SSM framework, and creates a series of entity classes, mapping classes, service classes, control classes and views which are designed hierarchically, thereby facilitating query use and update management in information management; the service logic, the data and the interface are separated through a layered design mechanism, the coupling degree of codes is reduced, and the maintainability and the expansibility of the system are greatly improved.
Drawings
FIG. 1 is a flow chart illustrating a SSM framework design method for hierarchical architectural design according to an embodiment of the present invention; and
fig. 2 is a schematic diagram illustrating an execution flow of each layer program of the SSM framework design method for hierarchical architecture design according to an embodiment of the present invention.
Detailed Description
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
Fig. 1 is a schematic flow chart of an SSM framework design method for standard system management system development according to an embodiment of the present invention, which includes the following specific steps:
and S1, decomposing the objects and the association relations managed by the standard system into entity information such as the standard system, system nodes and standard bibliographies and relation information such as a standard system structure and a standard system list.
S2, building a Spring + Spring MVC + Mybatis development environment according to the SSM framework, wherein the specific mode is as follows:
s21, creating a Maven project, setting a project object model Pom.xml, configuring a project module, adding elements such as warehouse and project resource dependency relationship required by the project, and specifying Spring and Mybatis versions and a core package. In pom.xml of the present example, project information such as artifactId, groupId, packing, etc. is set, and the spring version is specified by spring version. The multiple dependency attributes are used in dependencies to add the warehouses and resource dependencies that the project needs to use one by one. The manner of adding the spring-aop core package is as follows:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-aop</artifactId>
<version>${spring.version}</version>
</dependency>
s22, configuring Spring in application context.xml, configuring data source, transaction manager and Mybatis. Xml of the example, setting context, annotation-configuration enabling annotation; setting context, namely enabling component-scan to start component scanning; setting the location attribute of propertyConfigrer, and specifying the location of the properties database configuration file; setting various attribute values of the sqlSessinfactory of Mybatis, configuring a database connection pool of Mybatis, a Mapper file scanning position and the like. The tx add tags, tx attribute tags, and tx method tags are set, specifying the method for all delete, insert, update, save for a transaction notification.
S23, configuring SpringMVC feature in spring-mvc.xml, mainly configuring distributor, mapping responder, controller and view parser. In spring-mvc.xml of the embodiment, an access interception class is set through an mvc, namely, interrupts tag; adding < MVC: annotation-driver/> enabling MVC annotation; adding < mvc, default-servlet-handle/> starting a default mapping response processor; setting files and suffixes under jsp folders as view analysis by adding beans of InternalResourceViewResolver;
s24, creating a global interceptor responsible for intercepting the URL so that the system input can be processed before being executed by the interception logic. In the embodiment, a LoginHandlerInterreceptor is created, the LoginHandlerIntercaptoraAdapter is inherited, a preHandle method is rewritten, user login data is read in the LoginHandlerIntercaptoraAdapter, and a service layer is called to carry out authority verification;
s3, creating a series of entity classes, mapping classes, service classes and views which conform to the SSM framework for each entity and relationship by realizing the standard system classes or interfaces of IOC, MVC and ORM; the concrete forms of the entity class, the mapping class, the service class, the controller and the view are as follows:
s31, creating an entity class and a mapping class as a persistence layer, realizing an entity logic relationship and SQL processing logic, and reading data from a database or writing data into the database; in the present example, taking the architecture as an example, a StdFrame entity class and a stdframemapper. xml mapping file are created;
xml sets the table and field of the mapped database through < sql > tag, and sets the corresponding StdFrame entity class and its attributes through < resultMap > tag. Setting sql statements for reading and writing to the database by tags < select >, < insert >, < update > and < delete >;
s32, creating a service class as a service logic layer, acquiring a user request from a controller, acquiring data from an entity class and a mapping class, performing service logic processing, and feeding back the processed data to the controller; in this example, taking the architecture as an example, an interface StdFrameService is created, and a class StdFrameService impl is created to implement the interface; the StdFrameServiceImpl adds class annotation @ Service ("StdFrameService"), wherein various methods such as addNode, deleteNode, updateNode and saveNode are realized for Service logic processing;
s33, a controller is created and is responsible for reading data from the view, sending the data to the service layer processing logic and feeding back the data after service processing to the view; in this example, taking architecture as an example, a class StdFrameController is created, a class annotation @ Controller and an MVC annotation @ RequestMapping ("stdframe") are added, the class includes methods such as addNode, deleteenode, updateNode, saveNode, getTree, and the like, and the main logics of the methods are to acquire data from a current page, call a corresponding method of StdFrameService to perform service processing, and set a corresponding display page for displaying;
and S34, taking the JSP page as a view for realizing data display and page interaction. In this example, taking the architecture as an example, create an std _ frame.jsp page for showing the architecture tree, and provide buttons for adding, modifying, deleting, saving, etc., to provide the user with an interactive function;
s4, as shown in fig. 2, the entity class, the mapping class, the service class, the controller and the view hierarchical program interact in the MVC manner, in this example, taking the architecture as an example, the specific manner is:
s41, the page sends a request to the controller, and the controller receives the request and calls a corresponding service class for processing; in this example, std _ frame.jsp sends a request of adding a node to a user to an StdFrameController, and the StdFrameController accepts the request and calls an addNode method of StdFrameService to perform service processing;
s42, the service class interacts with the database by calling the entity class and the mapping class, and returns the result to the controller after the service processing logic is carried out; in this example, the StdFrameService adds data by calling the stdframeentity class, finally adds the data to the database through the mapping relationship between the stdframeentity class and the database table in the stdframemapper.xml, and feeds back the processing result to the StdFrameController;
s43, the controller calls a corresponding page, the view rendering and data showing are carried out on the processing, and finally the client side obtains a response; in this example, StdFrameController calls std _ frame.
Compared with the traditional information management system, the embodiment of the invention adopts the SSM framework with the layered design, so that when the parameters are described in the standard system, only the mapping class needs to be modified, the flexibility is improved through SQL modification, the expansion can be realized without other modifications, and the problems of difficult expansion, inconvenient maintenance and even incapability of maintenance of the traditional information management system are solved. In addition, when the customized interface is improved and personalized and the user interaction is carried out, the embodiment of the invention only needs to modify the code of the view page without rewriting the business logic. Therefore, the problem that the coupling degree of the code constructed by the existing standard system is too high is solved, and the difficulty of system maintenance is greatly reduced.
The above-mentioned embodiments are merely illustrative of the preferred embodiments of the present invention, and do not limit the scope of the present invention, and various modifications and improvements made to the technical solution of the present invention by those skilled in the art without departing from the spirit of the present invention shall fall within the protection scope defined by the claims of the present invention.
Claims (5)
1. A design method of an SSM framework for hierarchical architecture design is characterized by comprising the following steps:
s1, decomposing the object and the incidence relation of the information management into entity information and relation information; the entity information comprises a standard system, system nodes and a standard bibliography; the relationship information comprises a standard system structure and a standard system list;
s2, building a Spring + Spring MVC + Mybatis development environment according to the SSM framework, and specifically comprising the following steps:
s21, creating a Maven project, setting the project object model, configuring the project module, adding the resource dependency relationship between the warehouse and the project which need to be used by the project, and designating Spring and Mybatis versions and a core package;
s22, configuring Spring, data source, transaction manager, Mybatis and Mapper files in the Spring configuration file;
s23, configuring the springMVC characteristics in a configuration file of springMVC, wherein the characteristics comprise a configuration distributor, a mapping responder, a controller and a view parser;
s24, creating a global interceptor which is responsible for intercepting the URL so that the system input can be processed before being executed by the interception logic;
s3, creating a series of entity classes, mapping classes, service classes and views which conform to the SSM framework for each entity and relationship by realizing the standard system classes or interfaces of IOC, MVC and ORM;
the entity class and the mapping class are used as persistence layers to realize entity logic relation and SQL processing logic and are responsible for reading data from a database or writing data into the database;
the service class is used as a service logic layer, a user request is obtained from a controller, data is obtained from the entity class and the mapping class, service logic processing is carried out, and the processed data is fed back to the controller;
the controller is responsible for reading data from the view, sending the data to the service layer processing logic and feeding back the data after service processing to the view;
the view is a JSP page and is used for realizing data display and page interaction;
s4, the entity class, the mapping class, the service class, the controller and the view interact in an MVC mode, and the specific interaction process is as follows:
s41, the page sends a request to the controller, and the controller receives the request and calls a corresponding service class for processing;
s42, the service class interacts with the database by calling the entity class and the mapping class, and returns the result to the controller after the service class performs service processing logic; and
and S43, the controller calls the JSP, view rendering is carried out on the result to display data, and finally the client side obtains a response.
2. The SSM framework design method for hierarchical architectural design according to claim 1, wherein in step S21, project modules are configured by setting artifactId, groupId and packing project information in the project object model; designating the spring version by spring version; the dependency attribute is used in dependencies to add the warehouses and resource dependencies that the project needs to use one by one.
3. The SSM framework design method for hierarchical architectural design according to claim 1, wherein in step S22, context is set in the configuration file of the spring, and context is set in component-scan enabled component scan; setting a location attribute of propertyconfigurrer to specify the location of the properties database configuration file; and setting an attribute value of sqlSessinfactory of Mybatis, and configuring a database connection pool and a Mapper file scanning position of Mybatis.
4. The SSM framework design method for hierarchical architectural design according to claim 1, wherein in step S23, in the configuration file of springMVC, an access interception class is set through mvc: interrupts tag; adding < MVC: annotation-driver/> enabling MVC annotation; adding < mvc, default-servlet-handle/> starting a default mapping response processor; view parsing is performed on files under a jsp folder and suffixes by adding a bean of the InternalResourceViewResolver.
5. The method of claim 1, wherein in step S24, an interceptor class is created that inherits the class handlernentercaptoradapter, and the method therein is rewritten to intercept the URL.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911290775.6A CN111143451A (en) | 2019-12-16 | 2019-12-16 | SSM framework design method for hierarchical architecture design |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201911290775.6A CN111143451A (en) | 2019-12-16 | 2019-12-16 | SSM framework design method for hierarchical architecture design |
Publications (1)
Publication Number | Publication Date |
---|---|
CN111143451A true CN111143451A (en) | 2020-05-12 |
Family
ID=70518326
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201911290775.6A Pending CN111143451A (en) | 2019-12-16 | 2019-12-16 | SSM framework design method for hierarchical architecture design |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN111143451A (en) |
Cited By (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111984312A (en) * | 2020-08-28 | 2020-11-24 | 上海睿成软件有限公司 | Method, device and storage medium for realizing compatibility of Java development framework |
CN112035276A (en) * | 2020-08-06 | 2020-12-04 | 上海视云网络科技有限公司 | Java-based cross-platform extensible Remote Procedure Call (RPC) framework design method |
CN112486461A (en) * | 2020-11-30 | 2021-03-12 | 彩讯科技股份有限公司 | Information processing system based on springboot frame |
CN112861059A (en) * | 2021-03-17 | 2021-05-28 | 平安消费金融有限公司 | Visual component generation method and device, computer equipment and readable storage medium |
CN114237774A (en) * | 2022-02-14 | 2022-03-25 | 北京安盟信息技术股份有限公司 | Internal calling method for removing dependence of functional module |
CN114416183A (en) * | 2020-10-28 | 2022-04-29 | 武汉软艺信息技术有限公司 | Method and device for rapidly restoring App state based on iOS system |
Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013142273A1 (en) * | 2012-03-19 | 2013-09-26 | Citrix Systems, Inc. | Systems and methods for providing user interfaces for management applications |
CN105843609A (en) * | 2016-03-18 | 2016-08-10 | 浪潮软件集团有限公司 | MVC frame based on Spring and MyBatis |
CN108196836A (en) * | 2018-01-31 | 2018-06-22 | 北京工业大学 | Blog system in enterprise based on SSM frames |
CN109783556A (en) * | 2018-12-24 | 2019-05-21 | 浙江工业大学 | Power quality controlling equipment on-line monitoring system and construction method based on Hadoop and SSM framework |
-
2019
- 2019-12-16 CN CN201911290775.6A patent/CN111143451A/en active Pending
Patent Citations (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2013142273A1 (en) * | 2012-03-19 | 2013-09-26 | Citrix Systems, Inc. | Systems and methods for providing user interfaces for management applications |
CN105843609A (en) * | 2016-03-18 | 2016-08-10 | 浪潮软件集团有限公司 | MVC frame based on Spring and MyBatis |
CN108196836A (en) * | 2018-01-31 | 2018-06-22 | 北京工业大学 | Blog system in enterprise based on SSM frames |
CN109783556A (en) * | 2018-12-24 | 2019-05-21 | 浙江工业大学 | Power quality controlling equipment on-line monitoring system and construction method based on Hadoop and SSM framework |
Non-Patent Citations (2)
Title |
---|
BIELEYANG: "SSM框架原理,作用及使用方法", 《CSDN》 * |
LEEQUALLS: "Construction of SSM (SPRING+SPRINGMVC+MYBATIS) Framework", 《PROGRAMMER THINK》 * |
Cited By (7)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112035276A (en) * | 2020-08-06 | 2020-12-04 | 上海视云网络科技有限公司 | Java-based cross-platform extensible Remote Procedure Call (RPC) framework design method |
CN111984312A (en) * | 2020-08-28 | 2020-11-24 | 上海睿成软件有限公司 | Method, device and storage medium for realizing compatibility of Java development framework |
CN114416183A (en) * | 2020-10-28 | 2022-04-29 | 武汉软艺信息技术有限公司 | Method and device for rapidly restoring App state based on iOS system |
CN112486461A (en) * | 2020-11-30 | 2021-03-12 | 彩讯科技股份有限公司 | Information processing system based on springboot frame |
CN112486461B (en) * | 2020-11-30 | 2024-04-09 | 彩讯科技股份有限公司 | Information processing system based on springboot framework |
CN112861059A (en) * | 2021-03-17 | 2021-05-28 | 平安消费金融有限公司 | Visual component generation method and device, computer equipment and readable storage medium |
CN114237774A (en) * | 2022-02-14 | 2022-03-25 | 北京安盟信息技术股份有限公司 | Internal calling method for removing dependence of functional module |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN111143451A (en) | SSM framework design method for hierarchical architecture design | |
EP3428811B1 (en) | Database interface agent for a tenant-based upgrade system | |
US10146824B2 (en) | Database job description and scheduling | |
CN104573115B (en) | Support the realization method and system of the integrated interface of multi-type database operation | |
US9128996B2 (en) | Uniform data model and API for representation and processing of semantic data | |
CA2624270C (en) | Interfaces for a productivity suite application and a hosted user interface | |
JP5065056B2 (en) | Method, computer program, and system for processing a workflow (integrating data management operations into a workflow system) | |
US7769698B2 (en) | Navigation through components | |
US7350184B2 (en) | System and method for enterprise application interactions | |
US9146955B2 (en) | In-memory, columnar database multidimensional analytical view integration | |
US8904363B2 (en) | Projecting software and data onto client | |
US8656056B2 (en) | Web-enabled mainframe | |
US8924914B2 (en) | Application creation tool toolkit | |
CN111966692A (en) | Data processing method, medium, device and computing equipment for data warehouse | |
US20140114916A1 (en) | Code generation and implementation method, system, and storage medium for delivering bidirectional data aggregation and updates | |
JP2024505236A (en) | Data set multiplexer for data processing systems | |
US7467373B2 (en) | Global object system | |
US9721230B2 (en) | Developer mode for workflow systems steering patch deployment | |
US8930960B2 (en) | Methods and systems for object interpretation within a shared object space | |
US20170039385A1 (en) | Record-level security access in workflows | |
US20230281339A1 (en) | Centralized data transformation in a multi-tenant computing environment | |
US8069172B2 (en) | Re-executing query objects without affecting transaction data in an application development framework not providing for creation of multiple instances of the same query object | |
Brunette | Open Data Kit 2: building mobile application frameworks for disconnected data management | |
CN117632395A (en) | Workflow processing method, device, apparatus, storage medium and program product | |
Beti et al. | Helvetas Horticulture System |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20200512 |
|
RJ01 | Rejection of invention patent application after publication |