Preface

Since its inception, the Spring Framework has gradually changed the rules of application development in the Java community. This book is the ideal guide and teaching companion for developers interested in learning about the Spring Framework and how it can be leveraged to build persistence-driven applications using Hibernate, one of the most popular Java persistence frameworks today. Spring Persistence with Hibernate gets you rolling with fundamental Spring concepts, as well as proven design patterns for integrating persistence into your applications.

Many of the lessons illustrated in this book were culled from years of practical experience building scalable, high-volume web applications using Spring and Hibernate. One of the details that stands out in our joint experience is the importance and benefit of learning through hands-on experience. To this end, we will build a real-world application that utilizes Spring 3, Hibernate 3.5, JPA 2.0, Hibernate-Search, Grails, Spring Roo, and Dozer. We firmly believe that learning about Spring and Hibernate implies far more than simply understanding the respective APIs of each framework. To be able to effectively develop with these two amazing technologies, it is necessary to understand the design patterns and best practices for getting the best from these frameworks, and building on them in a consistent, proven manner. We hope this book will teach you more than just how to use Spring and Hibernate together. Our goal is to channel the development experience, lessons, and best practices we've seen work successfully in our experience, so that you can apply these skills and tools in your own applications.

Throughout these pages, we will introduce core Hibernate fundamentals, demonstrating how the framework can be best utilized within a Spring context. We will start with foundational concepts, such as strategies for developing an effective domain model and DAO layer, and then move into querying techniques using HQL, JPQL, and the Criteria API. After fundamental concepts are introduced, we will move on to more advanced topics, such as fetching and caching strategies. We will also illustrate several approaches for architecting a transactional service facade. Both programmatic and declarative transactions will be examined, showcasing the benefits of using Spring for expressing transactional semantics.

Spring Persistence with Hibernate will also introduce JPA, covering its history and the ways in which Hibernate influenced its development. We will discuss the benefits of following the JPA standard, as well as when it makes sense to utilize Hibernate-specific features. The book will also introduce Grails and GORM, illustrating the differences between the DAO and Active Record patterns. We will port our sample application (which will be developed in the course of the book) into both Grails and Spring Roo, highlighting the benefits and differences of using a rapid-development, convention-over-configuration platform. In these sections, we will explore topics related to concurrency/optimistic locking, Hibernate Session state, caching approaches, and transaction management.

The last part of the book will introduce several advanced techniques, important for working with enterprise Spring/Hibernate applications. We will illustrate some of the pitfalls with integrating legacy databases, as well as best practices for developing REST web services, handling Hibernate proxies and lazy collections, as well as building search functionality using Hibernate-Search.

Here are some of the main topics we will discuss in this book:

  • Basic Spring Framework features such as IoC and AOP

  • Core concepts for architecting a well-layered persistence tier

  • JPA concepts and steps for integrating JPA

  • Foundational and advanced concepts for working with Hibernate

  • Hibernate querying techniques

  • DAO and Service Facade layer development

  • Grails, along with the introduction of Active-Record Pattern

  • Introduction of Spring Roo

  • Building a REST web service

  • Translating between a domain model and a DTO using Dozer

  • Leveraging other frameworks and technologies, such as Hibernate-Search

  • Advanced Caching and Integration strategies

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.137.37