NHibernate 3 Beginner's Guide
暫譯: NHibernate 3 初學者指南

Dr. Gabriel Nicolas Schenker, Aaron Cure

  • 出版商: Packt Publishing
  • 出版日期: 2011-08-20
  • 售價: $1,880
  • 貴賓價: 9.5$1,786
  • 語言: 英文
  • 頁數: 368
  • 裝訂: Paperback
  • ISBN: 1849516022
  • ISBN-13: 9781849516020
  • 相關分類: Java 相關技術
  • 已絕版

相關主題

商品描述

Rapidly retrieve data from your database into .NET objects

  • Incorporate robust, efficient data access into your .Net projects
  • Reduce hours of application development time and get better application architecture and performance
  • Create your domain model first and then derive the database structure automatically from the model
  • Test, profile, and monitor data access to tune the performance and make your applications fly
  • Clear, precise step-by-step directions to get you up and running quickly

In Detail

Ideally, we would want to persist the objects our application uses and produces AS IS, without having to first transform them in complex ways. NHibernate is a framework that provides us with an object-oriented access to a relational database without having to write SQL and with little or no database-specific data access code. Definitely, if you are a .NET developer, knowing more about NHibernate will simplify and reduce your efforts in developing .Net applications.NHibernate 3 Beginner's Guide introduces Nhibernate with step-by-step examples, and is the easiest way to learn about bridging the gap between object-oriented .NET applications and the relational database that stores the application's data. It is a beginner's guide to NHibernate that starts from scratch. Successive chapters build upon earlier concepts, while the sample code presents various ways to accomplish typical data access tasks.

NHibernate 3 Beginner's Guide examines all of the topics required to get a functional data access layer implemented while writing the least amount of code possible, presenting options along the way to handle particular edge cases or situations as they arise. The book begins with an introduction to NHIbernate 3 and then moves on to creating the development environment. Then it teaches you how to create a model, define a database schema, and map the model to the database then covers sessions and transactions. This is succeeded by testing, profiling, and configuration, validation of data and writing queries. Finally, we wrap up with notes on the common pitfalls that you should avoid.

Once you complete reading the book, you will have gained the skills and knowledge to incorporate NHibernate into your own applications.

An easy-to-follow guide that will show you how to connect the NHibernate object-relational mapper to your projects to create a rich, efficient, object-oriented data access layer with little or no additional work

What you will learn from this book

  • Create a domain model
  • Learn different techniques to map the domain model to the underlying database
  • Build the database from your model automatically
  • Use session and transactions to persist and retrieve data
  • Efficiently query the database by using LINQ to NHibernate and HQL
  • Configure your system for use of NHibernate in a clear and concise way
  • Write unit and integration tests for your data access layer
  • Learn about the common pitfalls that should be avoided
  • Implement data validation on the entity level
  • Monitor and profile your data access

Approach

This is a beginner's guide with comprehensive step-by-step instructions. There are appropriate screenshots throughout the book and plenty of code, which is explained in a well-thought-out format.

Who this book is written for

If you are a new or seasoned developer of .NET web or desktop applications who is looking for a better way to access database data, then this book is for you. It is a basic introduction to NHibernate, with enough information to get a solid foundation in using NHibernate. Some advanced concepts are presented where appropriate to enhance functionality or in situations where they are commonly used. Absolutely no knowledge of NHibernate is required to read this book.

商品描述(中文翻譯)

快速從資料庫中檢索資料到 .NET 物件

- 將穩健且高效的資料存取整合到您的 .NET 專案中
- 減少數小時的應用程式開發時間,並獲得更好的應用程式架構和效能
- 首先創建您的領域模型,然後自動從模型推導資料庫結構
- 測試、分析和監控資料存取,以調整效能並使您的應用程式運行更快
- 清晰、精確的逐步指導,讓您快速上手

詳細內容

理想情況下,我們希望能夠以原樣持久化應用程式使用和產生的物件,而無需先以複雜的方式轉換它們。NHibernate 是一個框架,為我們提供了對關聯資料庫的物件導向存取,而無需撰寫 SQL,並且幾乎不需要任何特定於資料庫的資料存取程式碼。對於 .NET 開發者來說,了解 NHibernate 將簡化並減少您在開發 .NET 應用程式時的工作量。《NHibernate 3 初學者指南》通過逐步示例介紹 NHibernate,是了解物件導向 .NET 應用程式與存儲應用程式資料的關聯資料庫之間的橋樑的最簡單方法。這是一本從零開始的 NHibernate 初學者指南。後續章節在早期概念的基礎上進行擴展,而示例程式碼則展示了完成典型資料存取任務的各種方法。

《NHibernate 3 初學者指南》探討了實現功能性資料存取層所需的所有主題,同時撰寫最少的程式碼,並在過程中提供處理特定邊緣案例或情況的選項。該書首先介紹 NHibernate 3,然後進入創建開發環境。接著教您如何創建模型、定義資料庫架構,並將模型映射到資料庫,然後涵蓋會話和交易。隨後是測試、分析和配置、資料驗證及撰寫查詢。最後,我們總結了應避免的常見陷阱。

一旦您完成閱讀本書,您將獲得將 NHibernate 整合到自己應用程式中的技能和知識。

這是一本易於遵循的指南,將向您展示如何將 NHibernate 物件關聯映射器連接到您的專案,以創建一個豐富、高效的物件導向資料存取層,幾乎不需要額外的工作。

您將從本書中學到的內容

- 創建領域模型
- 學習將領域模型映射到底層資料庫的不同技術
- 自動從您的模型構建資料庫
- 使用會話和交易來持久化和檢索資料
- 通過使用 LINQ to NHibernate 和 HQL 高效查詢資料庫
- 以清晰簡潔的方式配置您的系統以使用 NHibernate
- 為您的資料存取層撰寫單元測試和整合測試
- 了解應避免的常見陷阱
- 在實體層級實施資料驗證
- 監控和分析您的資料存取

方法

這是一本初學者指南,提供全面的逐步指導。書中有適當的截圖和大量程式碼,並以精心設計的格式進行解釋。

本書的讀者對象

如果您是尋找更好方式來存取資料庫資料的新手或資深 .NET 網頁或桌面應用程式開發者,那麼這本書適合您。這是一本 NHibernate 的基本介紹,提供足夠的信息以建立使用 NHibernate 的堅實基礎。在適當的情況下,還會介紹一些進階概念,以增強功能或在常見使用情況下使用。閱讀本書完全不需要 NHibernate 的任何知識。