官术网_书友最值得收藏!

Explaining the approach used in learning NHibernate

Before we actually talk about the application, I thought I will write about the overall approach that I will take to teach you NHibernate.

In this chapter, we will define a simple problem statement. The aim is to implement an efficient data access layer for our problem using NHibernate as we progress through the chapters in this book. In this process, you will learn about important NHibernate features and apply them to an actual software problem at the same time. When we finish the book, we may not have addressed the complete data access requirements of our problem, but we will have implemented the solutions for important aspects of the problem with a certain level of detail. This level of understanding and some experience should set up to build any kind of data access solution using NHibernate.

It may seem disconnected to jump from the problem statement to the data access layer directly, so my first step is to come up with a domain model that captures the core concepts of our problem domain. I will try to follow the guidelines from Object-oriented Analysis and Design (OOAD) and Domain-driven Design (DDD). Both are much specialized areas of software design and explaining them in detail will be another book in itself. So, I will try to keep it to a level sufficient to build a simple domain model for our problem in the right way.

As we go on building our data access layer, we also need a way to validate the correctness of our implementation. Since we are going to build it brick by brick, a lot of times, we will need to go back and change something that was previously implemented as we learn more about NHibernate. While we change things, we need a way to make sure that our changes have not altered the outcomes or have broken a feature that was working previously. We will use TDD to implement our solution. If you have already used TDD, then you will know what I am talking about. If you are new to TDD, then do not worry. TDD is not very difficult to master, and for the kind of work that we are going to do around TDD, you do not need to master the art. We are going to write simple tests that validate the behavior of our data access layer. We will then use NHibernate to build the missing pieces and make our tests pass. I will make sure that I give you enough explanation of the code that I am going to present.

For most part of this book, the solution will be implemented in the form of a class library supported by unit tests to validate the correctness of the code. Towards the end of the book, we should be able to look at the complete solution and understand how NHibernate is used in real-life applications.

主站蜘蛛池模板: 出国| 四子王旗| 湖南省| 万山特区| 衡东县| 梨树县| 阳曲县| 景洪市| 罗源县| 昭苏县| 响水县| 读书| 驻马店市| 承德县| 湘阴县| 白银市| 山东省| 沧源| 阿拉善盟| 遵义县| 磐石市| 九寨沟县| 五台县| 高青县| 双峰县| 马尔康县| 岚皋县| 惠来县| 石柱| 浦江县| 铜山县| 泸定县| 日喀则市| 富蕴县| 卓尼县| 阜康市| 锦屏县| 绥阳县| 获嘉县| 濉溪县| 多伦县|