August 18th, 2009, 06:51 PM
Design patterns: Table Module and Table Data Gateway
Well, I've been analyzing some of the Fowler's enterprise patterns lately, and I have some problems in applying these two patterns together. To complicate things even more, I'm a TDD practitioner
Although I like domain driven design more, I want to see what is else out there ...
First question would be if you have ever used these patterns? I'd love to hear some quality answers!
Second question would assume the answer to first is positive; the question is how did you use them together? The book has very little info on this, and so does the Internet (or should I say mighty Google). I really have some rough times testing these patterns, most of all because I don't understand how should they fit together (nightmarish Dependency Injection).
Should Table Modules reference each other when they need data that "belongs" into "others" realm; like when you need some specific Product detail (type - or name) in Order Table Module. From OrderModule, should I work with ProductModule (domain layer) or ProductGateway (data layer)? I could have a class that needs to be injected with several of these Modules/Gateways, just to be able to do some database independent TDD
In Fowlers book, there are examples that include CRUD logic in the Table Modules, but he says that we should use Table Gateway (which also has CRUD logic). It makes little sense to me ...
If this topic looks like a lot of grumpy rumbling, I could type some example to show you what I mean... Any help would be very appreciated. Thank you !
Tags for this Thread
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.