Persistence in the Enterprise: A Guide to Persistence Technologies

Book description

The Definitive Guide to Today’s Leading Persistence Technologies

Persistence in the Enterprise is a unique, up-to-date, and objective guide to building the persistence layers of enterprise applications. Drawing on their extensive experience, five leading IBM® Web development experts carefully review the issues and tradeoffs associated with persistence in large-scale, business-critical applications.

The authors offer a pragmatic, consistent comparison of each leading framework--both proprietary and open source. Writing for IT managers, architects, administrators, developers, and testers, the authors address a broad spectrum of issues, ranging from coding complexity and flexibility to scalability and licensing. In addition, they demonstrate each framework side by side, via a common example application. With their guidance, you’ll learn how to define your persistence requirements, choose the most appropriate solutions, and build systems that maximize both performance and value.

Coverage includes

  • Taking an end-to-end application architecture view of persistence

  • Understanding business drivers, IT requirements, and implementation issues

  • Driving your persistence architecture via functional, nonfunctional, and domain requirements

  • Modeling persistence domains

  • Mapping domain models to relational databases

  • Building a yardstick for comparing persistence frameworks and APIs

  • Selecting the right persistence technologies for your applications

  • Comparing JDBC™, Apache iBATIS, Hibernate Core, Apache OpenJPA, and pureQuery

  • The companion web site includes sample code that implements the common example used throughout the technology evaluation chapters, 5-9.

    The IBM Press developerWorks® Series is a unique undertaking in which print books and the Web are mutually supportive. The publications in this series are complemented by resources on the developerWorks Web site on ibm.com. Icons throughout the book alert the reader to these valuable resources.

    Table of contents

    1. Copyright
    2. IBM Press: The developerWorks® Series
    3. IBM Press
      1. Information Management
      2. Computing
      3. Business Strategy & Management
      4. Rational and Software Development
      5. WebSphere
      6. Lotus
      7. Open Source
    4. Acknowledgments
      1. The Author Team
      2. Roland Barcia
      3. Geoffrey Hambrick
      4. Kyle Brown
      5. Robert Peterson
      6. Kulvir Singh Bhogal
    5. About the Authors
    6. Introduction: Why You Should Steal This Book—with Apologies to Abbie Hoffman
    7. I. A Question of Persistence
      1. 1. A Brief History of Object-Relational Mapping
        1. The Object-Relational Impedance Mismatch
        2. A Pre-Java History Lesson
          1. Delphi
          2. Rogue Wave DBTools.h++
          3. NeXT DbKit
          4. TopLink for Smalltalk
          5. IBM ObjectExtender
        3. First-Generation Java Solutions
          1. JDBC 1.0 and 2.0
          2. TopLink for Java
          3. EJB 1.0
          4. VisualAge Persistence Builder
          5. EJB 2.0
        4. Open Source and the Next Generation
          1. Hibernate
          2. iBATIS
        5. Assimilating the Object Database Counterculture
          1. ODMG
          2. JDO
          3. JPA
        6. Service-Oriented Architecture and Beyond
          1. Information as a Service
          2. pureQuery and ProjectZero
        7. Summary
        8. References
      2. 2. High-Level Requirements and Persistence
        1. Some “Required” Background
          1. Understanding Your Stakeholders
          2. Different Strokes for Different Folks
        2. Executives and the Needs of the Business
          1. Hardware and Software Dependencies
          2. Standards Supported
          3. Open-Source and Community-Driven Activities
          4. Vendors, Licenses, and Support
          5. Intellectual Property Considerations
          6. Availability of Skilled Practitioners
          7. Availability of Education and Mentors
          8. Development and Administration Tools
          9. Build Versus Buy?
        3. IT Leaders and Enterprise Quality Solutions
          1. Functionality and Business Processes
          2. Reliability and Transactional Requests
          3. Usability and User Sessions
          4. Efficiency and Runtime Resources
            1. Isolation Levels Trade CPU Utilization for Better Throughput
            2. Caching Trades Memory for Better Response Times
          5. Maintainability and Application Components
          6. Portability and Standard Platforms
            1. What Happened to Portable Persistence Promised by Entity EJB Components?
            2. Understanding the Real Portability Requirements for Persistence Frameworks
          7. Interoperability and Enterprise Quality Solutions
        4. Summary
        5. Links to developerWorks
        6. References
      3. 3. Designing Persistent Object Services
        1. Some Basic Concepts
          1. Pattern Languages
          2. The Domain Model Pattern
        2. Domain Modeling Best Practices
          1. Choose a Modeling Notation to Communicate the Essential Details
          2. Involve Project Stakeholders in Creating and Modifying the Domain Model
          3. A Domain Model Is Not a Design Model
          4. Domain Models Are Not Always Necessary
          5. Plan for Change
        3. The Value of a Common ORM Example
          1. Domain Model
          2. Database Schema
          3. Database Constraints
          4. Database Normalization Approach
          5. Service Interfaces
          6. Unit Test Cases
        4. The Object-Relational Mapping Impedance Mismatch Revisited
          1. Association
          2. Composition
          3. Containment
          4. Encapsulation
          5. Inheritance
            1. Class Table Inheritance Strategy
            2. Concrete Table Inheritance Strategy
            3. Single Table Inheritance Strategy
          6. Polymorphism
          7. Object Identity
          8. Object Navigation
        5. Object-Relational Mapping Approaches
          1. Top-Down
          2. Bottom-Up
          3. Meet-in-the-Middle
        6. Other Patterns to Consider
          1. Metadata Mapping, Lazy Loading, and Unit of Work
          2. Distributed Façade and Data Transfer Objects
        7. Summary
        8. Links to developerWorks
        9. References
      4. 4. Evaluating Your Options
        1. Comparing Apples to Apples
          1. Putting Good, Better, and Best into Context
          2. Establish an Independent Standard
          3. Make a List and Check It Twice
          4. Keep It Real
        2. Persistence in Your Enterprise
          1. One Size Does Not Fit All
          2. Ask Not If, but What and Why
          3. The Devil Is in the Details
        3. An Evaluation Template You Can Use
          1. Background
            1. Type of Framework
            2. History
          2. Architectural Overview
            1. Standards Adherence
            2. Platforms Required
            3. Other Dependencies
            4. Vendors and Licenses
            5. Available Literature
          3. Programming Model
            1. Initialization
            2. Connections
            3. Transactions
            4. Create
            5. Retrieve
            6. Update
            7. Delete
            8. Stored Procedures
            9. Batch Operations
            10. Extending the Framework
            11. Error Handling
          4. ORM Features Supported
            1. Objects
            2. Inheritance
            3. Keys
            4. Attributes
            5. Contained Objects
            6. Relationships
            7. Constraints
            8. Derived Attributes
          5. Tuning Options
            1. Query Optimizations
            2. Caching
            3. Loading Related Objects
            4. Locking
          6. Development Process for the Common Example
            1. Defining the Objects
            2. Implementing the Services
            3. Packaging the Components
            4. Unit Testing
            5. Deploying to Production
        4. Making the Most out of Your Experience
          1. Use the Questionnaire Early and Often
          2. Record Your History So You Don’t Repeat It
        5. Summary
        6. Links to developerWorks
        7. References
    8. II. Comparing Apples to Apples
      1. 5. JDBC
        1. Background
          1. Type of Framework
          2. History
        2. Architectural Overview
          1. Standards Adherence
          2. Platforms Required
          3. Other Dependencies
          4. Vendors and Licenses
          5. Available Literature
        3. Programming Model
          1. Initialization
          2. Connections
          3. Transactions
          4. Create
          5. Retrieve
          6. Update
          7. Delete
          8. Stored Procedures
          9. Batch Operations
          10. Extending the Framework
          11. Error Handling
        4. ORM Features Supported
          1. Objects
          2. Inheritance
          3. Keys
          4. Attributes
          5. Contained Objects
          6. Relationships
          7. Constraints
          8. Derived Attributes
        5. Tuning Options
          1. Query Optimization
          2. Caching
          3. Loading Related Objects
          4. Locking
        6. Development Process for the Common Example
          1. Defining the Objects
          2. Implementing the Services
            1. loadCustomer
            2. openOrder
            3. addLineItem
            4. removeLineitem
            5. submitOrder
          3. Packaging the Components
          4. Unit Testing
          5. Deploying to Production
        7. Summary
        8. Links to developerWorks
        9. References
      2. 6. Apache iBATIS
        1. Background
          1. Type of Framework
          2. History
        2. Architectural Overview
          1. Standards Adherence
          2. Platforms Required
          3. Other Dependencies
          4. Vendors and Licenses
          5. Available Literature
        3. Programming Model
          1. Initialization
          2. Connections
          3. Transactions
          4. Create
          5. Retrieve
          6. Update
          7. Delete
          8. Stored Procedures
          9. Batch Operations
          10. Extending the Framework
          11. Error Handling
        4. ORM Features Supported
          1. Objects
          2. Inheritance
            1. Inheritance Examples
            2. Discriminator Result Mapping
          3. Keys
          4. Attributes
          5. Contained Objects
          6. Relationships
          7. Constraints
          8. Derived Attributes
        5. Tuning Options
          1. Query Optimizations
          2. Caching
            1. Single-JVM Caching
            2. Distributed Caching
          3. Loading Related Objects
          4. Locking
        6. Development Process of the Common Example
          1. Defining the Objects
          2. Implementing the Services
            1. loadCustomer
            2. openOrder
            3. addLineItem
            4. removeLineItem
            5. submitOrder
          3. Packaging the Components
          4. Unit Testing
          5. Deploying to Production
        7. Summary
        8. Links to developerWorks
        9. References
      3. 7. Hibernate Core
        1. Background
          1. Type of Framework
          2. History
        2. Architectural Overview
          1. Standards Adherence
          2. Platforms Required
          3. Other Dependencies
          4. Vendors and Licenses
          5. Available Literature
        3. Programming Model
          1. Initialization
          2. Connections
          3. Transactions
          4. Create
          5. Retrieve
          6. Update
          7. Delete
          8. Stored Procedures
          9. Batch Operations
          10. Extending the Framework
          11. Error Handling
        4. ORM Features Supported
          1. Objects
          2. Inheritance
          3. Keys
          4. Attributes
          5. Contained Objects
          6. Relationships
          7. Constraints
          8. Derived Attributes
        5. Tuning Options
          1. Query Optimizations
          2. Caching
          3. Loading Related Objects
          4. Locking
        6. Development Process for the Common Example
          1. Defining the Objects
          2. Implementing the Services
            1. bootstrapping
            2. loadCustomer
            3. openOrder
            4. addLineItem
            5. removeLineItem
          3. Packaging the Components
          4. Unit Testing
          5. Deploying to Production
        7. Summary
        8. Links to developerWorks
        9. References
      4. 8. Apache OpenJPA
        1. Background
          1. Type of Framework
          2. History
        2. Architectural Overview
          1. Standards Adherence
          2. Platforms Required
          3. Other Dependencies
          4. Vendors and Licenses
          5. Available Literature
        3. Programming Model
          1. Initialization
          2. Connections
          3. Transactions
          4. Create
          5. Retrieve
          6. Update
          7. Delete
          8. Stored Procedures
          9. Batch Operations
          10. Extending the Framework
          11. Error Handling
        4. ORM Features Supported
          1. Objects
          2. Inheritance
            1. Single Table Strategy
            2. Joined Strategy
            3. Table-per-Class Strategy
          3. Keys
          4. Attributes
          5. Contained Objects
          6. Relationships
          7. Constraints
          8. Derived Attributes
        5. Tuning Options
          1. Query Optimizations
          2. Caching
          3. Loading Related Objects
          4. Locking
        6. Development Process of the Common Example
          1. Defining the Object
          2. Implementing the Services
          3. Packaging the Components
          4. Unit Testing
          5. Deploying to Production
        7. Summary
        8. Links to developerWorks
        9. References
      5. 9. pureQuery and Project Zero
        1. Background
          1. Type of Framework
          2. History
        2. Architectural Overview
          1. Standards Adherence
          2. Platforms Required
          3. Other Dependencies
          4. Vendors and Licenses
          5. Available Literature
        3. Programming Model
          1. Initialization
            1. Data API
            2. Project Zero
          2. Connections
            1. Data API
            2. Project Zero
          3. Transactions
            1. Data API
            2. Project Zero and Transaction Closures
          4. Create
            1. Data API
            2. Project Zero
          5. Retrieve
            1. Data API
            2. Project Zero
          6. Update
            1. Data API
            2. Project Zero
          7. Delete
            1. Data API
            2. Project Zero
          8. Stored Procedures
          9. Batch Operations
          10. Extending the Framework
          11. Error Handling
        4. ORM Features Supported
          1. Objects
          2. Inheritance
          3. Keys
          4. Attributes
          5. Contained Objects
          6. Relationships
          7. Constraints
          8. Derived Attributes
        5. Tuning Options
          1. Query Optimizations
          2. Caching
          3. Loading Related Objects
          4. Locking
        6. Development Process for the Common Example
          1. Defining the Objects
          2. Implementing the Services
            1. loadCustomer
            2. openOrder
            3. addLineItem
            4. removeLineItem
            5. submitOrder
          3. Packaging the Components
          4. Unit Testing
          5. Deploying to Production
        7. Summary
        8. Links to developerWorks
        9. References
      6. 10. Putting Theory into Practice
        1. The Evaluations at a Glance
          1. Background
          2. Architectural Overview
          3. Programming Model
          4. ORM Features Supported
          5. Tuning Options
          6. Development Process for the Common Example
        2. What Do You Do Now?
          1. Don’t Reinvent the Wheel to Avoid Making Trade-offs
          2. Embrace and Extend Open-Source Projects
          3. Use an Agile Process and Continually Refactor
          4. Be Prepared to Revisit Your Decisions
        3. Summary
        4. Links to developerWorks
        5. References
    9. A. Setting Up the Common Example
      1. Brief Background of Supporting Technologies
        1. Apache Derby
        2. Eclipse
        3. JUnit and DbUnit
      2. Setting Up the Prerequisites
        1. Download Source Code
        2. JDK 5.0
        3. Eclipse 3.2+
        4. Apache Derby Eclipse Plug-in
          1. Project Zero M1 Eclipse Plug-In
      3. Importing and Running the Code for a Particular Persistence Technology
        1. Importing the Java SE Applications
        2. Resolving DbUnit for the Projects
        3. Add Apache Derby Nature
        4. Start the Apache Network Server
        5. Running the Database Script
        6. Running the JDBC Unit Test
        7. Resolve iBATIS Dependencies
        8. Running the iBATIS JUnit
        9. Resolve Your Hibernate Dependencies
        10. Running the Hibernate Application
        11. Resolving OpenJPA Dependencies
        12. Run Byte Code Enhancement for OpenJPA
        13. Running the OpenJPA Application
        14. Running Project Zero Application
        15. Running EJB3 Application with IBM EJB 3 Feature Pack
        16. Troubleshooting
      4. References

    Product information

    • Title: Persistence in the Enterprise: A Guide to Persistence Technologies
    • Author(s): Roland Barcia, Geoffrey Hambrick, Kyle Brown, Robert Peterson, Kulvir Singh Bhogal
    • Release date: May 2008
    • Publisher(s): IBM Press
    • ISBN: 9780768680591