100 likes | 179 Views
New Technology: Why, What ,How. Requirement . Current way of doing things. Problem . Generic Solution or Design Pattern. Available solutions in market. Hibernate . Where to read from ?. Typical Requirement. App Data Needs to be persisted. Data generally Outlives Applications.
E N D
New Technology: Why, What ,How • Requirement . • Current way of doing things. • Problem . • Generic Solution or Design Pattern. • Available solutions in market. • Hibernate . • Where to read from ?
Typical Requirement • App Data Needs to be persisted. • Data generally Outlives Applications. • Application : Object Oriented Language -> Java , C# • Databases : Relational Databases. • Mid-Size App : Around 35% code involves Persistence Layer
Current way • Domain Model and Schema are Designed Separately. • Tables Classes Tables. • Transformation: Manual SQL and results are mapped to Objects. • Lots of SQL Row becomes an Object Instance. • Developers responsibility of mapping OO Instances to Tables row and Column.
Problem • Object Relational Impedance: Resistance or Obstruction. 1. Structural Problems: a) Java Types vs. SQL Types. b) User Defined Types. c) Inheritance. 2.Behavioral Mismatch : a) Tables :data ,Objects :data and Behavior . b) Polymorphism. c) Equality. d) Associations. 3. Granularity. 4. Data Navigation.
Problem • Large Systems : a) Cache Management b) Transaction Handling. • SQL dependent on Underlying DB : Portability ??
Constraints :Fundamental Shift Reason’s why we cant change the way we work. • Move to OO Databases : Gemstone,Db4O a) RDBMS backed by Mathematics. b) Performance in Data Management. c) Already Huge Investment In RDBMS. • Move away From OO Concepts: a) We All know benefits of OO principles . b) Shines in Complex Domain Structure. So We have to live with Previous Problems.
General Solution Goal : We want to directly manipulate data contained in a relational database using an object programming language (Java). SOLUTION: Use a mapping layer to map between the object world and the relational world. • Automate task of converting Tables Classes Tables. • Framework to optimize I/O transaction's b/w App layer and DB. • Framework having a Cache Management. • Runtime SQL generation :portability across different Db Vendors. This resulted in number of Home-grown ORM frameworks.
Available solutions • Lots of ORM frameworks now available in market.
Why Hibernate • Quite Mature and vast functionality. • Open-Source . • Substantial User base. • Heavily influenced JPA specification, Industry approved. • Close to EJB 3 Specification. • Good Caching and Transaction management functionality available. • Support for almost all available Databases. • Learning Curve is Easy: a) Lots of material on Net. b) Many Books now available.
Resources • http://www.hibernate.org/hib_docs/reference/en/html_single/ • http://www.hibernate.org/78.html • http://www.java201.com/resources/browse/2003/hibernate.html