FREE hit counter and Internet traffic statistics from

Sunday, November 14, 2004

Organizing Domain Logic

There are many different ways of organizing domain logic in Business Components that encapsulate calculations, validations, and other logic that drives the central functionality of an application or service. One of the books I like as a software architect is Patterns of Enterprise Application Architecture by Martin Fowler. In that book Fowler defines three architectural patterns (here listed in increasing order of complexity) that designers use to organize domain logic. I’ll explore each of these patterns as they apply to .NET development in a series of upcoming articles.

  • Transaction Script. This pattern involves creating methods in one or a few Business Components (classes) that map directly to the functionality that the application requires. The body of each method then executes the logic, often starting a transaction at the beginning and committing it at the end (hence the name). This technique is often the most intuitive but is not as flexible as other techniques and does not lead to code reuse. This pattern tends to view the application as a series of transactions.
  • Table Module. This pattern involves creating a Business Component for each major entity used in the system or service and creating methods to perform logic on one or more records of data. This pattern takes advantage of the ADO.NET DataSet and is a good mid-way point between the other two. This pattern tends to view the application as sets of tabular data.
  • Domain Model. Like the Table Module, this pattern involves creating objects to represent each of the entities in a system, however, here each object represents one Business Entity rather than only having one object for all entities. Here also, the logic for any particular operation is split across the objects rather than being contained in a single method. This is a more fully object-oriented approach and relies on creating custom classes. This pattern tends to view the application as a set of interrelated objects.

In additon to these patterns I'll also look at how the Service Layer pattern interacts with these. Should be fun.


Anonymous said...

Do want to know the magic of online games, and here you can get more ro zeny. Do you want to have a try? Come on and ragnarok zeny can make you happy.You can change a lot iro zeny for play games. And you will enjoy yourself at the same time. Playing online games can make much cheap zeny. And you can use the ragnarok online zeny do what you want to do in the online game. Come and join with us. We are waiting for your coming.

Adi said...

Oes Tsetnoc one of the ways in which we can learn seo besides Mengembalikan Jati Diri Bangsa. By participating in the Oes Tsetnoc or Mengembalikan Jati Diri Bangsa we can improve our seo skills. To find more information about Oest Tsetnoc please visit my Oes Tsetnoc pages. And to find more information about Mengembalikan Jati Diri Bangsa please visit my Mengembalikan Jati Diri Bangsa pages. Thank you So much.
Oes Tsetnoc | Semangat Mengembalikan Jati Diri Bangsa

Anonymous said...

Microsoft Office
Office 2010
Microsoft Office 2010
Office 2010 key
Office 2010 download
Office 2010 Professional
Microsoft outlook
Outlook 2010
Windows 7
Microsoft outlook 2010

Anonymous said...

five fingers shoes
?Thus, this confession was made, and now I am the winner of many favorable disorders for new shoes plus work

Gucci Travel Business Bags
They have developed a motorcycle helmet that can achieve this splendor

beats by dre outlet
After years associated with research, doctors realize that it's better than almost all

discount beats by dre
If you have never skilled, I suggest you go get hold of these headphones, as this is your first practical knowledge, where you can feel the audio, not the head set

When fully implemented, most of these agreements allow the U

Vibram FiveFingers Bikila

Anonymous said...

iabaratti, like the majority of men about the excursion, driven for you to San Felipe with regards to 230 mile after mile (354 km's) to the south with the national boundaries city of Tijuana all over Nike Air Max through HillcrestIn stated within a quick record e-mailed towards the Linked MediaDALVAY BY-THE-SEA, Prince Edward Area (AP) Prince Bill enjoyed showing his or her army heli-copter instruction with his first-ever h2o landing Saturday to the Air Max 2011 pleasure involving nervous throngs in Canada, exactly where he / she with his fantastic better half, Kate, have been getting their first recognized international excursion considering that the weddingYour woman spoke to him quickly by simply Ed Hardy Shop cellular phone and also claimed he or she pointed out some thing about a electrical surpriseYour vessel capsized a lot less than 3 mls (Three kms) coming from shore, even so the fast extensive it is Discount Burberry Cheap look for 58 a long way (One hundred kilometers) further into your west coast of florida after Saturday after searching the spot by helicopter and airline in addition to obtaining absolutely nothing, Pineda explained Benjamin Pineda Ed Hardy Shop Gomez explained he simply no identify or even specifics of the guy who past awayExxon Mobil has projected of which approximately Just one,000 casks, or maybe 49,000 gallons, connected with crude oil poured Exclusive previous night Nike Air Jordan Cheap your move in the destroyed pipe ended up being quit But temperatures reached the particular mid-90s Wednesday, inducing the melt connected with off-road snow in order to speed up"They shed almost everything,Inch she said, such as air jordan clearance car keys