| Data persistence and transaction processing are hot issues and mainstream technologies in current enterprise applications. They have been the remarkable and crucial research tasks in Computer Science.In this paper, the type and using method of data persistence have been analyzed, and then a robust framework of persistence layer has been presented. Focusing on the possible problems on the using of persistence layer, some extension to the persistence layer has been put forward. Presently, there isn't a product which unifies the file storage method and the database storage method in domestic market. On this account a integrated framework of data persistence layer has been designed based on the database storage method. In this framework, the file storage method can also be supported by using the database storage technology. Transaction is also an issue of the paper. The transaction mechanism and its using method in framework have been discussed in detail.DAO pattern is the design basis of the proposed framework in which VO pattern and DTO pattern have also been included. On the basis of theoretic research and practice, the conclusion that the three patterns (DAO, VO and DTO) can be absolutely unified has been arrived at.Java class reflection mechanism is also a foundation of the persistence layer in this paper and it has also been discussed. Contrasted with direct method invocation and method reference invocation, through function test, the persistence layer based on class reflection is proved to be a feasible scheme.The project "Shaanxi Customer Service Support System" which the author participated in the Shaanxi Electric Power Information & Telecom CO.,LTD. is the background of the paper. Plenty of theoretic research, design practice and developing work has been carried out. Based on the practice, the presented framework of persistence layer has been implemented and used in practical projects and achieved good results. |