WHAT'S IN THIS CHAPTER?
When and how to use the Transaction Script pattern to organize business logic
When and how to use Active Record with the Castle Windsor project to organize business logic
When and how to use the Domain Model pattern with NHibernate to organize business logic
Explanation of the difference between the Anemic Model and the Domain Model patterns to organize business logic
Understanding domain-driven design (DDD) and how to use it to focus your efforts on business logic rather than infrastructure concerns
The business layer is arguably the most import layer within any enterprise application, so it's important to organize your business logic in the most appropriate manner that befits the complexity of your application. In this chapter you will be introduced to four patterns first published in Fowler's Patterns of Enterprise Application Architecture book: Transaction Script, Active Record, Anemic Model, and Domain Model. Each of these domain logic patterns has strengths and weaknesses depending on what type of application you are building.
Armed with knowledge of the architectural patterns to organize your domain logic, you will then read about DDD, a design method that can help you understand the business domain that you are modeling more effectively and ensure that the business needs are at the forefront of your mind.
Not all applications are equal, and not all require a complex ...