Font Size: a A A

Design And Implementation Of Object-relational Mapping Hardcoded

Posted on:2006-04-22Degree:MasterType:Thesis
Country:ChinaCandidate:C L HuangFull Text:PDF
GTID:2208360152481558Subject:Communication and Information System
Abstract/Summary:
With the development of complexity and scale of modern software, the business data have grown more and more. Many business systems are more dependent on relational database. In according to the wide using of object-oriented method in the front application, there must be a object-relation mapping mechanism to map the objects in the memory to the persistent relational database. So object-relation mapping has been an important part of business softwares. There are three basic solutions of ORM: hard-coding, data layer, robust persistent layer. Many methods can implement these sulutions. All methods have different pros and cons, and should be used in different situations. In this paper, I will forward two hard-coding methods to implement object-relation mapping. Embedded Polymorphic SQL Method(EPS), forwarded in this paper, take full advantage of inheritance of classes to divide long SQL statement. The devided SQL statements will be deployed to nodes of the whole class hierarchy. Call links will be made by polymorphism of OO property to complete various operations of database access in coordination. This method use the thought of OO to improve the reusability of code and reduce the effort of maintainance. Another method, Template Method, use the template method of OO design pattern to implement ORM. This method can also impove the resuability of code and achieve unified mechanism. These two are all methods of effective management of code. In the last of this paper, I will discuss and analyse some design problems encountered in practice. All the examples in this paper are coming from Management Information System of Argus (Shanghai) Textile Chemicals Co., Ltd.
Keywords/Search Tags:Object Relation Mapping, ORM, hard-coding, Design Pattern
Related items