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

  • Learning NHibernate 4
  • Suhas Chatekar
  • 489字
  • 2021-07-16 13:08:43

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.

主站蜘蛛池模板: 宣武区| 凤翔县| 仙居县| 常州市| 锡林浩特市| 宜丰县| 满洲里市| 鄢陵县| 宁武县| 德清县| 平原县| 桐乡市| 老河口市| 札达县| 台安县| 怀集县| 肥东县| 那坡县| 邛崃市| 大化| 平定县| 山西省| 酒泉市| 乌兰浩特市| 环江| 扎赉特旗| 丰城市| 菏泽市| 乌拉特中旗| 汝阳县| 合作市| 土默特右旗| 镇康县| 镇坪县| 越西县| 大荔县| 资讯 | 大丰市| 莫力| 涞水县| 克什克腾旗|