Chapter 3. Writing and mapping classes

 

This chapter covers

  • POCO basics for rich domain models
  • The concept of object identity and its mapping
  • Mapping class inheritance
  • Association and collection mappings

The “Hello World” example in chapter 2 gave a gentle introduction to NHibernate; but we need a more thorough example to demonstrate the needs of real-world applications with complex data models. For the rest of the book, we explore NHibernate using a more sophisticated example application—an online auction system.

We start our discussion of the application by introducing a programming model for persistent classes.

First, you’ll learn how to identify the business objects (or entities) of a problem domain. You’ll create a conceptual model of these entities and their attributes, called a domain model. You’ll implement this domain model in C# by creating a persistent class for each entity, and we’ll spend some time exploring what these .NET classes should look like.

3.1. The CaveatEmptor application

 
 
 

3.2. Implementing the domain model

 
 

3.3. Defining the mapping metadata

 
 
 
 

3.4. Basic property and class mappings

 

3.5. Understanding object identity

 

3.6. Fine-grained object models

 

3.7. Introducing associations

 
 
 

3.8. Mapping class inheritance

 
 
 

3.9. Summary

 
 
 
sitemap

Unable to load book!

The book could not be loaded.

(try again in a couple of minutes)

manning.com homepage
test yourself with a liveTest