论文标题:对象/关系映射在.NET平台下的研究与应用 O/R Mapping in .NET Platform Application and Research 论文作者 论文导师 曹旭光,论文学位 硕士,论文专业 软件工程 论文单位 吉林大学,点击次数 94,论文页数 92页File Size1126K 2007-11-01论文网 http://www.lw23.com/lunwen_994312252/
在现代软件开发业.net和java的基础类库,都是完全面向对象的,而持久化数据的存储多采用成熟的关系数据库系统,但面向对象的面向对象模型却与关系数据库系统的关系数据模型存在“阻抗不匹配”问题;应用一个ORM组件,设计一个透明的持久层,将可以解决这个问题。应用这个持久层将极大的提高软件开发效率,从而把开发人员从重复的低级劳动中解放出来,使其更多的关注于业务逻辑的需要。 本文结合对象/关系映射理论,对在.NET平台下实现ORM技术的映射工具Genome实现对象/关系映射的方法进行研究,并最终在社保系统中得到应用。 本文的主要工作集中在: 1.对象/关系映射技术的研究。根据面向对象模型和关系模型的理论,对模型间的“阻抗不匹配”进行了探讨和研究,并提出相应映射策略与方法。 2.对.NET平台下实现对象/关系映射技术的工具Genome进行研究。对象/关系映射需要专门的工具来实现,本文采用国外成熟的对象/关系映射工具Genome来实现.NET平台下的对象/关系映射。 3.对象/关系映射技术在社保系统的应用通过对社保系统的需求分析及设计,根据社会保险行业政策的不断完善,需求范围的不断扩展,用户对系统操作控制要求变化多样,社保系统中部分系统算法纷繁复杂,对社保的建设提出更高的要求的特点。应用对象/关系映射技术创建一个透明的持久层来应对这种不断完善及变化多样的业务需要。 通过在.NET平台下应用对象/关系映射技术,对系统在快速适应用户本地化需求、缩短开发周期、降低系统开发、维护成本、降低代码修改量及应对需求变动及系统的组件复用性等方面都得到了显著的提高。 The current social insurance industry MIS systems, the basic technology has applications in object-oriented technology with relational database systems, and the modern software development industry net and java foundation class libraries are completely object-oriented. In durable storage of data on the use of mature relational database systems, however, the object-oriented Model of Object-Oriented exists "impedance mismatch" problem with relational database system’s relational data model. Targeted to the programs object data within the data in the data storage’s inconsistencies are often complicated by the need to achieve the conversion (the "impedance mismatch"). This mapping always follow the same set of patterns, that is a lot of repeat manual work and repeat code, which causes the mixed results both meaningless difficulty and consumption in program development and hardness to maintain. In order to change this inefficient mapping mode, improve the efficiency of the development process and reduce code writing and increases the flexibility of procedures and response capabilities, this paper is exploring to application Object / Relational Mapping technology to the establishment of a durable transparent layer to solving the "impedance mismatch" problem among models. In this paper, "social security systems" for the background, try to solve the problem of "impedance mismatch" on the .NET platform application ORM components in the social security system. Beginning early 1990s, O/R Mapping (object/relational mapping) technology began development for resolving the impedance mismatch problem between object domain and the relationship model. After years of development, from Scott W Ambler released in 1998 on the ORM Persistence Layer after the detailed design of papers , Artem Rudoy realized an open source project PL (Persistence Layer), and of a test to the feasibility the advanced nature of the Scott’s lasting layer design. The ORM makes components associated with the study and implementation of the rapidly become a hot spot. From then emerged in a lot of ORM software, which is well-known: Hibernate, ObjectSpaces, XPO, Genome, etc.. The object / relational mapping technology has been improved and developed. Based on the relational model and object model theoretical research, in-depth exploration and study of the relationship between model and the resulting object model "impedance mismatch". Addressing the "impedance mismatch" issues corresponding mapping strategies and methods. And mapping strategies and methods for comparative study. And concluded, in the practical application should be based on practical problems, choose a different mapping strategies and methods to improve the efficiency and rationality of the mapping. The object/relational mapping technology ultimate through the tool in the system to achieve. So this is a choice abroad on .NET platform mature ORM tools Genome were studied, And conduct experiments on the method the components achieving object/relational mapping technology. The component achieves to the mapping between object and relational database, using an XML document to define the mapping, and the use of a class of lasting with the same name to XML mapping file with the corresponding XML documents. In this code, adopted on the conduct of this lasting object’s operation, like the operation in the relationship database table. In this process, only to see lasting objects, but not table. A real sense of the pure object-oriented programming. When the need to change the table structure, only need to amend the corresponding mapping file can be, they do not have to everywhere in the code to find and modify code. The availability of object/relational mapping to achieve theoretical basis and selected components, this paper on the preparations for the realization of the social security system. The national policy and business processes on the basis of social insurance industry policy has continually improved, expanding the scope of the demand, user requirements for controlling the operation of the system changes in diversity, the social security system part of the system algorithms are intricate and complex, the building of social security features, higher demands. A needs analysis. While on business operations will be classified into six most systematic and structural design of the overall handling agency for social security and other relevant units provide interactive data interface. Based on the analysis of demand in the overall system architecture design plans and the establishment of the system software architecture. In application of the system design object / relational mapping technology to the overall design of the system. Reference MVC design pattern, the three levels of response system, the interface layer, respectively, the operation control layer, logic for the design and realization. Then, through the C / S and B / S mode and the development of J2EE and. NET platform, the development model of the system and platform choices. Finally in the realization of system applied object/relational mapping technology. Through the creation of a durable transparent layer of the system to the business layer and data access layer was isolated by the construction of a durable transparent layer model to eliminate the "impedance mismatch." At the same time according to the characteristics of a lasting, durable layer document revision, but also should constantly improve and diverse business needs change, and change database tables on the system. Practice has proved that in the application of mature object-oriented language tools (. NET or Java), while applications mature relational database (SQL Server, Oracle) storage technologies such as social insurance MIS program development, will have a great deal of manual duplication of work and duplication code, to a large extent by this development should focus more attention to business logic and code maintenance, these problems with the model to some extent the "impedance mismatch" issues. Through the object model and the relationship between the model to build a durable transparent layer, this model will eliminate the problem. At the same time the development of social insurance such as MIS systems development, the transparent layer in addition to the elimination of a lasting model of the "impedance mismatch" problem, allowing the system to adapt to the rapid localization needs of users and shorten the development cycle and reduce systems development, maintenance costs, lower volume of code revision, timely respond to changes in demand and component reuse system such areas have been significantly improved.
|