I’ve been reading a book written by Martin Fowler on Patterns of Enterprise Application Architecture. It’s a very interesting book and I’m now contemplating on organizing the domain logic in layers and mapping it to relational databases. I find it a very hard matter how to make a bridge between a relational database working with foreign keys and a Object Model working with references to other objects. In the beginning of our big project we made a decision to have the domain logic on the client side in a flex application. On the server side we have a tool ‘SubSonic’ that does a lot of work for us, but not enough. The client expects certain Data Transfer objects from the server that are more complex than the tables in the database. This means that working with a Row Data Gateway of Table Data Gateway and sending those instances to Flex is not an option. Sometimes objects are complex and have collections of other objects. So we need Data Mappers to map SubSonic instances to DTO instances. And now we have even ported some of the Domain Logic to the server because we need to create reports and this can only be done on server side due to performance issues. So now we have a SubSonic Model, a DTO Model and the Domain Logic… In my opinion this is too much… I will try to have a look at LINQ but I’m not sure that this will make things easier. Also, changing something to the domain logic needs to be done now in two places… In AS3 (Flex) and in C# (.NET)… But if we have the domain logic also on the servers side, it can be a big advantage in the future (SilverLight, Reporting Services, …).

I am now looking at Identity Maps and I’m wondering if I’ll need an identity map for DTO’s and for Domain Logic… I thing I’ll just go for now with Identity Maps for the DTO’s. There’s a big difference between a Client running in a single thread and a server running different threads for different client requests. I’m hoping to be able to cache things on the server side using Unit of Work patterns.

Ciao! Johlero!

pixel Patterns of Enterprise Application Architecture
No TweetBacks yet. (Be the first to Tweet this post)