nhibernate最新書籤
b# - A Journey with Domain Driven Design (and NHibernate) - Part 4 
b# - A Journey with Domain Driven Design (and NHibernate) - Part 4 
elleryq 收藏於 2007/07/26
Anyway, last time we introduced some very basic unit tests. We simply verified that we can indeed create each object and pass in the invariants as constructor parameters. The only real decision making that this influenced was how to create objects. For example, it is no problem at all to allow direct creation (public constructor) on root objects such as Movie, Video, Account, and Customer, however I chose not to let Transaction be created directly, rather it is created from an existing Account object. The reason for this is simple. Picture what happens at a video store: You go to the counter with your card and your videos, the employee scans the card and sees your account details. The next thing that the employee will do is start a new transaction. An account object is always present at the time that we need to get a transaction object. Another reason for this is I decided to satisfy the invariants of the transaction (specifically the account) at creation time.
分類:軟體
b# - A Journey With NHibernate (and DDD) - Part 3 
b# - A Journey With NHibernate (and DDD) - Part 3 
elleryq 收藏於 2007/07/26
I decided to somewhat rename this series to include Domain-Driven Design. It became apparent after Part One and Part Two that I will spend a lot of time just developing the domain model. I could either skip this step and start with a fully functional model, ready for persistence, or I can slow down a bit and focus on creating the domain model as well. Due to some recent feedback I am choosing to focus a bit on modeling the application. This will of course delay the NHibernate specifics, but a good understanding of the object model is crucial to effective object-relational mapping. On we go….
分類:軟體
b# - A Journey With NHibernate - Part 2 
b# - A Journey With NHibernate - Part 2 
elleryq 收藏於 2007/07/26
This time I am going to start off creating a pet project to demonstrate how to implement these ideas. First we’ll implement a simple domain model to support our features. We will combine these with unit tests to verify behavior.
Let’s create a dummy video rental system. We’ll call it Videocracy (hey, that’s pretty good!). In this sytem we’ll have to support the following features:
* Add new Customer / Account
* Add other members to an account
* Restrict certain members from renting certain content
* Query for a Customer by Customer # (swipe card, etc), phone number, or last name
* Add new rental item (movie, video game, game console, vcr, etc)
* Rent an item to a customer
* Check items back in from a customer
* Get movies checked out for a customer
* Calculate late fees for a customer
* Query for an item, see who has it
分類:軟體
b# - A Journey with NHibernate - Part 1 
b# - A Journey with NHibernate - Part 1 
elleryq 收藏於 2007/07/26
In this series of articles, I am going to dive into some topics with NHibernate. There is a lot of beginner information on the internet, but not a whole lot of real-life examples. I’ve seen countless exaples where the author builds a session factory, creates a session, and does some persistence all inside a single method or block of code. This is of course ludicrous for real projects. This is something I’d like to address. I’ll try to focus on things like proper object-oriented design and testability with your projects.
In the first few articles, we will see how to start projects using NHibernate, go over some basic topics, and then get progressively more complex as we explore the many features of the ORM tool.
If you don’t know what NHibernate is, I’d suggest a google search or going to the NHibernate home page.
分類:軟體
NHibernate Query Generator « .net and other musings 
NHibernate Query Generator « .net and other musings 
elleryq 收藏於 2007/06/26
NHQG is a console application which when pointed at your NHibernate mapping files, produces a bunch of partial classes for the types in your domain model which ultimately generate NHibernate DetachedCriteria. The real goodness is in the expressiveness of the querying API which they create.
分類:軟體




標籤:





標籤:

訂閱