Font Size: a A A

The Research And Instance Of A Development Method Based On Spring+Hibermate

Posted on:2006-11-24Degree:MasterType:Thesis
Country:ChinaCandidate:Z LiuFull Text:PDF
GTID:2168360182957201Subject:Computer system architecture
Abstract/Summary:PDF Full Text Request
At present, the Java technologies which come from Java open resources community prevails day by day, and they are mostly the improvements of some previous ones'drawbacks. There are some technologies with such characteristics replace them, including expensive cost, less invasion generally needed by industy, less lightweight and easier to test. In this paper, I will introduce three ideas by which we can develop enterprise software without EJB, and I will research a new method to develop enterprise application software based on Spring+Hibernate. The result shows we can easily and quickly develop an enterprise application which has the advantage over actual technology of high degree of reusing component. Then I develop a project management system(pms) to test the method. The pms has good performances and suits to the point of view of most enterprisese application. IoC means that container controls the relationship between each component, but in traditional way, it is controlled by program code directly. Definition of the IoC is that the control power is given from program code to outside container. The transformation of the control power is also called inversion. Definition of the DI is that container in the runtime determines the dependency relationship of components, just as containers inject some dependency relationship into the component dynamically. IoC mode can delay the realization of the interface, and realize them according to need. Just like an empty mold, inject gypsum to them in the case of necessary, and make a model in this way, so, the realization of control interface is called "injection". AOP is extending of OOP, AOP pursues the decoupling between the caller and the called, and it is also a realization of this target. AOP mainly aims at aspects of the business processing to pick up, what it faces is some step or stage in the business processing, in order to obtain the low-coupling effect among every part during logic process. ORM means Object Relational Mapping, which is a persistent data method at bottom layer. Then we use the popular lightweight container Spring, which greatly supports these two core technologies, and establish a method to develop enterprise application software system assistant by Hibernate. It meets the point of view of most enterprise. It provides more flexible function of service shift and easier reusability. When the environment changes, business logic needn't modify, only need changing configuration files and the whole system runs well. The key concept of Spring is IoC, it behaves that high layer component does not depend on low layer component, component depends on abstract but not the implement of abstract, application program does not depend on container, but container serves application program. In this way, in order to make the reliance minimum and improve the reused of components, the developer can finish the dependency injection among the subassemblies. Spring is a low invasion framework and the component in Spring does not realize itself in Spring in fact, it makes component, even framework, easy to be integrated. Another importance of Spring is to the support of AOP, AOP frame is a sub-framework which Spring framework supports. Hibernate is a kind of ORM in essence. The above POJO reflected here is the semanteme of Object layer of ORM, but mapping file is the relative ligament between object and relational date, in the Hibernate, mapping files usually make ".hbm.xml" as the suffix.Then we introduce the process and method to configure Hibernate. The implementation of pms includes 4 layers according to the responsibility. There are Presentation, Persistence, Business and EIS. Each layer has specific responsibility in its program processing without having the same function with others layers, and each layer should be different with others, but interfaces are needed between two layers. We create domain objects first. First of all, we should determine which objects need persistence and which ones will offer to business logic and the ones are used to display the interface; Secondly, the configuration of the Persistency Layer and the definition of OR mappings for Hibernate; And thirdly, the definition of the Business Objects. After, we will connect them with Spring; At last, we provide Spring with a Persistency Layer from which we know how can it communicate with Business Service Layer and how to deal with the exception thrown by other layers. Especially, the most important part in the system is ACH.xml. It is a bus through which beans can be organized together to finish program processing. We used MS SQL server and Jbuilder9 as IDE in our development. Tomcat5 is used as application server to detect the access port of the IE6.0. Through experiment the system meets point of the view of enterprise applicetion and realizes flexible Multi-layers architecture, furthermore brings a light-weighted, low invasion, high reusability of components.
Keywords/Search Tags:Spring+Hibermate
PDF Full Text Request
Related items