摘要
该文对轻量级Web开发框架Spring进行了研究,对Spring的核心机制之一的IOC(Inversion of Control)进行了剖析。首先从思想上的层面探讨了Spring框架的核心思想IOC,接着从底层代码上分析了Spring IOC的具体实现原理,包括Java工厂模式和Java反射机制在Spring IOC中是如何体现的。最后将Spring框架应用于临沂木业员工管理系统中,同时临沂木业员工管理系统集成Hibernate框架和Struts框架分别作为系统的持久层和表示层。通过采用Spring框架中的IOC,临沂木业员工管理系统中的底层的辅助代码和管理员模块、员工的增删改查模块、部门模块等业务逻辑代码实现了很好的分离。正因为代码的很好分离,使得系统在维护、修改、扩展和移植上有了很大的改善。
In this paper, the lightweight Web development framework Spring is studied, and the IOC(Inversion of Control),one of the core mechanisms of Spring, is analyzed. First of all, this paper discusses the core idea of Spring framework from the ideological level, and then analyzes the specific implementation principles of Spring IOC from the underlying code, including how the Java factory model and the Java reflection mechanism are embodied in Spring IOC IOC. Finally, the Spring framework applied to Linyi wood staff management system, at the same time, Linyi wood staff management system integrated with Hibernate framework and the Struts framework as the system persistence layer Through the use of AOP in the Spring framework, Linyi wood staff management system in the bottom of the auxiliary code and administrator module, staff additions and deletions to check module, Department module and other business logic code to achieve a good separation. Because of the good separation of code, the system has been greatly improved in maintenance, modification, extension and transplantation.
出处
《电脑知识与技术》
2018年第1X期116-117,120,共3页
Computer Knowledge and Technology