CN105843638A - Upgrading and reconstruction method for Spring old version framework - Google Patents

Upgrading and reconstruction method for Spring old version framework Download PDF

Info

Publication number
CN105843638A
CN105843638A CN201610157514.7A CN201610157514A CN105843638A CN 105843638 A CN105843638 A CN 105843638A CN 201610157514 A CN201610157514 A CN 201610157514A CN 105843638 A CN105843638 A CN 105843638A
Authority
CN
China
Prior art keywords
spring
configuration
bean
java
file
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
Application number
CN201610157514.7A
Other languages
Chinese (zh)
Inventor
刘福明
杨培强
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Inspur Software Group Co Ltd
Original Assignee
Inspur Software Group Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Inspur Software Group Co Ltd filed Critical Inspur Software Group Co Ltd
Priority to CN201610157514.7A priority Critical patent/CN105843638A/en
Publication of CN105843638A publication Critical patent/CN105843638A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/60Software deployment
    • G06F8/65Updates

Landscapes

  • Engineering & Computer Science (AREA)
  • Software Systems (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Security & Cryptography (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

Abstract

The invention discloses an upgrading and reforming method of a Spring old version framework, belonging to the field of Spring frameworks and comprising the following steps: 1) updating the spring jar package and modifying the spring configuration file; 2) adding transaction control configuration in the application context.xml; 3) updating the mybatis jar package, and putting the new mybatis jar package under a WEB-INF/lib directory. Xml file is updated, the definition of java beans is added, and the beans are used for transferring data between the foreground and the background; 4) and configuring the mapping of the fields in the mapper file. The method and the system have the advantages that the basic configuration is loaded firstly, then the service components are loaded in a self-defined mode, and the Map is replaced by the java bean, so that the occurrence of confusion is avoided.

Description

A kind of upgrading method of Spring legacy version framework
Technical field
The present invention relates to computer software technical field, the upgrading of a kind of Spring legacy version framework Method.
Background technology
Some old frameworks have been widely used and have had stable and quickly exploitation feature, and simply framework uses Spring edition comparison is old.Always having some difficulties when we think upgrade-system, such as code is more hard to understand or we do not slap Hold source code.Based on the problem run into during using, it would be desirable to system is carried out some and improves, including spring version liter Level, renewal transaction controlling mode, authority data transmission.
The spring version that old Spring framework uses is 2.X, and the mode directly replacing spring jar bag can not complete Upgrading, old Spring framework loads the mode of Service Component and loads different from common spring, adds self-defined loading Process.Self-defining loading procedure weakens the correlation function of spring.
The mybatis that DAO layer uses also is early version, and new version function is more, and the code write is less.Old Spring platform use Map is as the foreground and background data medium of exchange, but field custom capitalization in data base, and front page layout Displaying field may often be such that capital and small letter use with, be so easily caused the confusion of data.
Summary of the invention
The technical assignment of the present invention is to provide the upgrading method of a kind of Spring legacy version framework, solves Spring old The problem of the upgrading of version framework, first new method loads configurations, loads industry by self-defining mode the most again Business assembly, uses java bean to replace Map, it is to avoid chaotic generation.
The technical solution adopted for the present invention to solve the technical problems is:
A kind of upgrading method of Spring legacy version framework, method step is as follows::
1), update spring jar bag, revise spring configuration file, Spring the beginning part is modified as
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http:// www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
This partial content is introduced into the labels such as tx, context, mvc, the aop in spring redaction, and these labels can introduce thing Business control, context, spring mvc and aop function;
2) in applicationContext.xml, increase the configuration of transaction controlling;
<tx:advice id="demoServiceAdvice">
<tx:attributes>
<tx:method name="delete*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" no-rollback-for="java.lang.RuntimeException" />
<tx:method name="insert*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" />
<tx:method name="tSave*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" />
<tx:method name="mSave*" propagation="REQUIRES_NEW" read-only=" false"
rollback-for="java.lang.Exception" />
<tx:method name="update*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" />
<tx:method name="find*" propagation="SUPPORTS" />
<tx:method name="get*" propagation="SUPPORTS" />
<tx:method name="select*" propagation="SUPPORTS" />
<tx:method name="query*" propagation="SUPPORTS" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="demoServicePointCut"
expression="execution(public * inspur.dzfp.shanghai.service.impl.*.* (..))" />
<aop:advisor advice-ref="demoServiceAdvice" pointcut-ref=" demoServicePointCut" />
</aop:config>
Configuration above is that the method to all classes under inspur.dzfp.shanghai.service.impl bag is blocked Cut, and perform corresponding transaction controlling according to the method for coupling;According to the configuration requirement of spring, other codes can be carried out thing Business controls;
3), update mybatis jar bag, new mybatis jar bag is put under WEB-INF/lib catalogue.Update Configuration.xml file, adds the definition of some java bean, and we will transmit between AM/BAM with these bean Data, it is to avoid use map;
As follows:
<typeAliases>
<typeAlias type="inspur.dzfp.shanghai.bean.DsptBean" alias=" DsptBean" />
……
4), the mapping of configuration field in mapper file,
As follows:
<resultMap type="DsqyBean" id="resultBean">
<id property="dsptbm" column="DSPTBM" />
<result property="nsrdzdah" column="NSRDZDAH" />
……
During system start-up, first load spring base containers, including data source, affairs, Service Component configuration bean;Base containers After loading completes, by the example of Service Component configuration bean(DirBeanConfig.java) load Service Component.
The upgrading method of a kind of Spring legacy version framework of the present invention compared with prior art, has following useful Effect:
Bean rather than map transmission data are used to be possible not only to avoid the inconsistent confusion caused of AM/BAM capital and small letter, moreover it is possible to obtain Obtain the lifting of efficiency.Mybatis uses the access speed of bean than map faster to have test to show;
Embodiment is simple, as other web program embodiment.Replace spring and mybatis jar bag, amendment The configuration file of spring and mybatis, the parameter obtained from the page when of exploitation is no longer put into map, is still put into In java bean, transmit data by java bean;
First load configurations, load Service Component by self-defining mode the most again, use java bean to replace Map, keep away Exempt from the generation of confusion.
Accompanying drawing explanation
Fig. 1 is the upgrading method flow chart of Spring legacy version framework of the present invention.
Detailed description of the invention
The invention will be further described below in conjunction with the accompanying drawings.
A kind of upgrading method of Spring legacy version framework, method step is as follows:
1), update spring jar bag, revise spring configuration file, Spring the beginning part is modified as
<beans xmlns="http://www.springframework.org/schema/beans"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:tx="http:// www.springframework.org/schema/tx"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:mvc="http://www.springframework.org/schema/mvc"
xmlns:aop="http://www.springframework.org/schema/aop"
xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/tx
http://www.springframework.org/schema/tx/spring-tx-3.0.xsd
http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-3.0.xsd
http://www.springframework.org/schema/mvc
http://www.springframework.org/schema/mvc/spring-mvc-3.0.xsd
http://www.springframework.org/schema/aop
http://www.springframework.org/schema/aop/spring-aop-3.0.xsd">
This partial content is introduced into the labels such as tx, context, mvc, the aop in spring redaction, and these labels can introduce thing Business control, context, spring mvc and aop function;
2) in applicationContext.xml, increase the configuration of transaction controlling;
<tx:advice id="demoServiceAdvice">
<tx:attributes>
<tx:method name="delete*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" no-rollback-for="java.lang.RuntimeException" />
<tx:method name="insert*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" />
<tx:method name="tSave*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" />
<tx:method name="mSave*" propagation="REQUIRES_NEW" read-only=" false"
rollback-for="java.lang.Exception" />
<tx:method name="update*" propagation="REQUIRED" read-only="false"
rollback-for="java.lang.Exception" />
<tx:method name="find*" propagation="SUPPORTS" />
<tx:method name="get*" propagation="SUPPORTS" />
<tx:method name="select*" propagation="SUPPORTS" />
<tx:method name="query*" propagation="SUPPORTS" />
</tx:attributes>
</tx:advice>
<aop:config>
<aop:pointcut id="demoServicePointCut"
expression="execution(public * inspur.dzfp.shanghai.service.impl.*.* (..))" />
<aop:advisor advice-ref="demoServiceAdvice" pointcut-ref=" demoServicePointCut" />
</aop:config>
Configuration above is that the method to all classes under inspur.dzfp.shanghai.service.impl bag is blocked Cut, and perform corresponding transaction controlling according to the method for coupling;According to the configuration requirement of spring, other codes can be carried out thing Business controls;
3), update mybatis jar bag, new mybatis jar bag is put under WEB-INF/lib catalogue.Update Configuration.xml file, adds the definition of some java bean, and we will transmit between AM/BAM with these bean Data, it is to avoid use map;
As follows:
<typeAliases>
<typeAlias type="inspur.dzfp.shanghai.bean.DsptBean" alias=" DsptBean" />
……
4), the mapping of configuration field in mapper file,
As follows:
<resultMap type="DsqyBean" id="resultBean">
<id property="dsptbm" column="DSPTBM" />
<result property="nsrdzdah" column="NSRDZDAH" />
……
During system start-up, first load spring base containers, including data source, affairs, Service Component configuration bean;Base containers After loading completes, by the example of Service Component configuration bean(DirBeanConfig.java) load Service Component.

Claims (2)

1. the upgrading method of a Spring legacy version framework, it is characterised in that method step is as follows::
1), update spring jar bag, revise spring configuration file, Spring the beginning part is introduced in spring redaction The labels such as tx, context, mvc, aop, these labels can introduce transaction controlling, context, spring mvc and aop function;
2) in applicationContext.xml, increase the configuration of transaction controlling;Right The method of all classes under inspur.dzfp.shanghai.service.impl bag intercepts, and according to the method for coupling Perform corresponding transaction controlling;
3), update mybatis jar bag, new mybatis jar bag is put under WEB-INF/lib catalogue, update Configuration.xml file, adds the definition of some java bean, and we will transmit between AM/BAM with these bean Data, it is to avoid use map;
4), the mapping of configuration field in mapper file.
The upgrading method of a kind of Spring legacy version framework the most according to claim 1, it is characterised in that system opens Time dynamic, first load spring base containers, including data source, affairs, Service Component configuration bean;Base containers has loaded After, by the example of Service Component configuration bean(DirBeanConfig.java) load Service Component.
CN201610157514.7A 2016-03-18 2016-03-18 Upgrading and reconstruction method for Spring old version framework Pending CN105843638A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610157514.7A CN105843638A (en) 2016-03-18 2016-03-18 Upgrading and reconstruction method for Spring old version framework

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610157514.7A CN105843638A (en) 2016-03-18 2016-03-18 Upgrading and reconstruction method for Spring old version framework

Publications (1)

Publication Number Publication Date
CN105843638A true CN105843638A (en) 2016-08-10

Family

ID=56587320

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610157514.7A Pending CN105843638A (en) 2016-03-18 2016-03-18 Upgrading and reconstruction method for Spring old version framework

Country Status (1)

Country Link
CN (1) CN105843638A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399081A (en) * 2018-02-09 2018-08-14 广州市两棵树网络科技有限公司 A kind of MyBatis reverse-engineerings generator
CN108733589A (en) * 2018-04-12 2018-11-02 阿里巴巴集团控股有限公司 The implementation method and device of distributed transaction heat deployment
CN109634653A (en) * 2018-11-30 2019-04-16 中链科技有限公司 A kind of resource allocation method and device based on component based architecture
CN110262787A (en) * 2019-06-21 2019-09-20 北京搜房科技发展有限公司 Sentence replacement method, device and electronic equipment
CN111026598A (en) * 2018-10-09 2020-04-17 迈普通信技术股份有限公司 Data acquisition method and device
CN112379865A (en) * 2020-11-03 2021-02-19 福建福诺移动通信技术有限公司 Software development framework updating method based on Maven plug-in mechanism

Cited By (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108399081A (en) * 2018-02-09 2018-08-14 广州市两棵树网络科技有限公司 A kind of MyBatis reverse-engineerings generator
CN108399081B (en) * 2018-02-09 2021-01-26 广州洋葱时尚集团有限公司 MyBatis reverse engineering generator
CN108733589A (en) * 2018-04-12 2018-11-02 阿里巴巴集团控股有限公司 The implementation method and device of distributed transaction heat deployment
CN108733589B (en) * 2018-04-12 2021-11-02 创新先进技术有限公司 Method and device for realizing distributed transaction hot deployment
CN111026598A (en) * 2018-10-09 2020-04-17 迈普通信技术股份有限公司 Data acquisition method and device
CN109634653A (en) * 2018-11-30 2019-04-16 中链科技有限公司 A kind of resource allocation method and device based on component based architecture
CN109634653B (en) * 2018-11-30 2023-08-01 苏州朗润创新知识产权运营有限公司 Resource allocation method and device based on componentized architecture
CN110262787A (en) * 2019-06-21 2019-09-20 北京搜房科技发展有限公司 Sentence replacement method, device and electronic equipment
CN110262787B (en) * 2019-06-21 2022-12-13 北京搜房科技发展有限公司 Statement replacement method and device and electronic equipment
CN112379865A (en) * 2020-11-03 2021-02-19 福建福诺移动通信技术有限公司 Software development framework updating method based on Maven plug-in mechanism

Similar Documents

Publication Publication Date Title
CN105843638A (en) Upgrading and reconstruction method for Spring old version framework
US6353926B1 (en) Software update notification
US7698684B2 (en) Method and system for generating schema to Java mapping descriptors and direct mapping of XML schema and Java interfaces
US8005930B2 (en) Add-ins dynamically extending display targets and business-logic programming model
US7665014B2 (en) Method and apparatus for generating forms using form types
US10013478B2 (en) System and method for modular business applications
US11741002B2 (en) Test automation systems and methods using logical identifiers
US20120124494A1 (en) Graphical user interface typing and mapping system
JP4726519B2 (en) Screen definition data difference extraction method, apparatus and program
EP1488344A2 (en) Document transformation
US20130151571A1 (en) Interface defined virtual data fields
US7945890B2 (en) Registry for electronic design automation of integrated circuits
US7328234B1 (en) Agent architecture for triggering remotely initiated data processing operations
US20070006199A1 (en) Methods and apparatus for communicating between multiple levels of software components
EP2466461B1 (en) System and method for modular business applications
US7203945B2 (en) Import/export utility and a method of processing data using the same
US7487227B2 (en) Scripting engine having a sequencer table and a plurality of secondary tables for network communication software
CN106354864A (en) Form saving method and system
CN101976381A (en) Method and system for managing application assets
KR100677141B1 (en) Apparatus and Method for performing an one to one name-based socket-communication
CN101488099A (en) Method and apparatus for centralized user information management
CN108920152B (en) Method for adding custom attribute in bugzilla
Sciore et al. Interactive Grids
KR20150099016A (en) A system for providing an application developing environment
KR20150099011A (en) A system for providing an application developing environment

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20160810

WD01 Invention patent application deemed withdrawn after publication