web 2.0

Domain Model

Decoration

Decoration

A better pattern for business logic layer.

Let me to introduce you the 3 base patterns to organize your domain logic: Transaction Script, Domain Model and Table Module.

Transaction Script
Organizes business logic by transactions. Logic for each of the CRUD operations and other business logic over data is encapsulated in one transaction script. So every transaction is a unique procedure which handles a single request from the presentation. These transactions usually do direct calls to the database like Stored procedures calls or Dynamic SQL queries.

Domain Model
An object model, which describes entities and relations between them in the domain. It’s one of the key aspects of Domain Driven Design.

Table Module
A single instance that handles the business logic for all rows in a database table or view.

For object-oriented programmers the Domain Model pattern would be the best understandable pattern, altgough many of them are still getting in touch mainly with the first Transaction Script pattern.

This article is about how Domain Model works, how to use it and how to implement it.
Continue reading »