advertisement
Login | Register   
  Include Code  Search Tips
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Partners & Affiliates
advertisement
advertisement
advertisement
advertisement
Average Rating: 5/5 | Rate this item | 1 user has rated this item.
 

A Pure Object-oriented Domain Model by a DB Guy, Part 5

This is the fifth part in a series of articles by Jimmy Nilsson on a new architecture for enterprise applications in .NET. The new architecture is purely object-oriented with maintainability as the number one goal, while still focusing on roundtrips and the data access code to get good performance. In this article, Jimmy will discuss the new architecture from a persistence access layer perspective. 


advertisement
s I write this, four parts have been published in this series (see the left column). Now is the time to focus on how to access the database.

As I said, what we are going to talk about today is the Persistence Access layer, found slightly to the right in Figure 1.

Those of you who are familiar with parts 1-4 will probably notice that I’ve changed the name of one of the layers in Figure 1. My old Application layer is now called Service layer instead so as to more closely follow Martin Fowler’s names in his PoEAA book [5]. By this I mean that the classes in my old Application layer were following the Service Layer pattern and so I found that Service layer would be a better layer name.

Figure 1 The layer model

The purpose of the Service layer [5] pattern is to provide a service-based view on a Domain Model [5]. It’s also the case that the Service layer classes will often contain some functionality of their own, and not only be a pass-through to the Domain Model.

I have to admit that changing the name of that layer after so many years was a painful decision to take, but I think it is important to adjust to what I think is, or at least will become, the de facto name standard.

The Persistence Access layer itself is pretty similar to what I had in my book [7] two years ago. The most important change is that I’m now working with a rich domain model.

Talking of changes, I’m also considering getting rid of the Shared methods in the Persistence Access layer. (The reason for doing this is that using Shared methods takes away the possibility of using interfaces and the power of inheritance. I think interfaces and inheritance come in handy here as a solution not only for extending the functionality but also for extending testability.) But I'll leave this for now, and will come back to it next time.

  Next Page: What's the Problem?
Page 1: IntroductionPage 5: FetchCustomers() in Service Layer
Page 2: What's the Problem?Page 6: Single Responsibility Principle
Page 3: Unit of WorkPage 7: Need for the Delegate Solution?
Page 4: Save() in Persistence Access LayerPage 8: Why Not Persistence Access?
Please rate this item (5=best)
 1  2  3  4  5
advertisement