Font Size: a A A

Ameliorative Design And Implementation Of Persistence Layer Basing ORM

Posted on:2009-09-11Degree:MasterType:Thesis
Country:ChinaCandidate:D ZhouFull Text:PDF
GTID:2178360245495420Subject:Computer technology
Abstract/Summary:PDF Full Text Request
The computer appearance has the epoch-making significance to the humanity, the computer is having the high speed computation ability, was completing the precise task and the batch computation aspect is stabler than the humanity, has become the assistance advance in technology force tool. Along with permanent storage medium (for example floppy disk and so on) the appearance, enable the computer also to have the humanity to be unable to hope to attain or equal "the memory ability".How manages, uses the computer "memory ability"? The Database technology arises at the historic moment. Had the database, we might preserve the data from the computer memory to other permanent storage equipment in are advantageous for in the future inquiry, the revision, this will also be the so-called data lasting.The Database technology passes through several generation of development, at present most is mature and applies widely is the relations database, it is develops from the mathematical model, with the strict mathematical logic and the method management data, has maturely, reliable, the highly effective data holds controls ability. But unfortunately, the database development has not been able to match with the software technology development. Along with the soft piece work project technology development, the object-oriented design, the method of exploitation already were the mainstream technologies which the software produces. But because relates the database is not object-oriented, this causes the data in the computer system to be able not but by two form existences, in the operational channel memory, the data performance is the object, displays in the database for the relational data. In the memory object has relations and so on connection and inheritance, but in the database is unable to display many to the multi-connections and the inheritance relations. In the object-oriented Database technology may before the mature application, in order to can the object data lasting to the relational database in, appeared the relational - object mapping (Object-Relationg Mapping to be called ORM) the thought and the technology.In the JAVA domain, visits the database through the JDBC programming is the traditional procedure, this procedure is most primitive, most direct. The JDBC database operation is based on the good collection, although it has the highly effective operating efficiency, must in the JAVA procedure the nesting massive SQL sentence, the application procedure shoulder arduously actually is holding controls the data the work, and causes the project to maintain with difficulty. Although may develop the independent lasting level according to the MVC thought through the JDBC programming, seals to the database operation, provides the unification the connection, for service level use. But this request has the very high specialized knowledge to JDBC, in the project organization, can not but extract the best design, the development personnel carries on the lasting level specially the design development, between service logic and data lasting plan difficult well distributed project group's development resource, enables the limited manpower to concentrate the service logic research, often creates in the project development not to be able to attend to one thing without losing track of another thing. Moreover as a result of the database structure difference, the lasting level which each time develops is unable to duplicate the use directly, causes the procedure multiplying to become difficult, each time all must develop the special-purpose actually function similar lasting level procedure, causes the project development to fall into in the repetition work and the low efficiency. Huge lasting level code along with project order of complexity increase, also can become maintains more and more with difficulty, the supposition project group initially developed the lasting level the personnel midway to withdraw, other personnel have filled the sql sentence and the data manipulation logic lasting level facing one, very difficult to carry on the effective maintenance in a short time.Lucky is, solves the above problem based on the ORM thought lasting level frame for us. ORM is one kind of description object and the relational data interconversion and the lasting object data principle thought, based on its software frame is the ORM frame, now has many ORM lasting frames to be possible to supply the choice, for instance EJB, Hibernate, IBATIS, TopLink, OJB and so on, they have undertaken the object data lasting prime task, not only may automatically carries on the object and the relational data the correspondence (certainly this need some earlier period disposition strategy), can have the sql sentence automatically, greatly reduced the application system lasting level code quantity, simultaneously also on greatly reduced development personnel's work load. They some are commercial character, some then right and wrong trade. In which non-commercial Hibernate is at present is maturest and uses the most widespread ORM frame. It the reason that can be popular, must give credit to following superiority:1. It opens the source. The exploiter may according to need to study its source code, has custom-made own function.2. It has the most detailed documents in all ORM frame, causes the research and the use is more convenient.3. Has only made the lightweight seal to JDBC, if has the necessity, the exploiter may bypass it, uses JDBC directly.4. Has the good extendibility, causes it to improve into possibly, finally and maintains the exuberant vitality.5. It is already suitable for the independent JAVA procedure, also is suitable for JAVA the WEB application, but also might with the EJB integration, develop its use scope greatly.6. it may with many kinds of WEB server, integrate using the server, and is suitable for the present nearly all mainstream database.This article first discusses the ORM frame to have the reason as well as its basic thought and the principle, in research with it correlation in object-oriented, lasting, lasting level, DAO, MDA theory thought as well as present popular ORM frame foundation, has analyzed its main merit, also summarizes its existence three main flaws.1 Because the object-oriented technical compulsion user user represents the relations data, this can cause massive redundant data depositing in the memory, these redundant data do not participate in current business processing, and time which finished in the life cycle is analyzed the construction function or trash collector release.2.Complex mappings and the connection management, caused ORM to have the tremendous influence to the system performance. In the ORM system, between the object usually through the object quotation and each kind of set attribute the object interdependence, composes a more complex compound object. The application procedure with through visits the member object to complete one by one visit to these compound object. This kind has caused the client side between many member object navigation operation and rear end between the database system gain operates the large scale increase, thus has caused the serious performance question. The3.ORM use configuration files and the annotation establish the mapping relations and the object correspondence, not yet put to full use type number according to what is believed rest (metadata), has brought the extra cost for the system development and the maintenance.In view of above three main flaws, this article from the inquiry, the buffer technology, the buffer prefetching algorithm, the disposition way improves three aspects to propose the improvement plan, achieved the reduction application system memory takes, enhances the ORM frame buffer hit probability and more succinct, a convenient disposition, the maintenance ORM frame goal.
Keywords/Search Tags:Persistencelayer, ORM, Hibernate, Prefetching, Prefetching buffer
PDF Full Text Request
Related items