I've done a bit of reading over the last couple days. DonXML mentioned Domain Driven Design (DDD) in a comment. This led me to a series of posts from Steve Eichert on DDD. This post of Steve's was very intriguing to me. He talks about the need for UI Mappers and how they could potentially make life easier.
Now you all know that I am not a fan of OR mappers. Actually that's not totally true. My issue is really with some of the dynamic ones that build their own dynamic SQL, etc. Sorry, I guess I'm a control freak... I want to know that the SQL being generated is my SQL and not someone else's. I also don't like code generation that is not my own code... I want to be able to understand every line of code, and be able to justify it if someone questions me on it... Which means that I use CodeSmith to generate my data access layer... I'm basically doing OR mapping with my templates.
So a UI Mapper maps entity objects to your UI objects. All that code where you say "tbAddress.Text = entity_obj.address;" could be built in a more dynamic manner.
So I downloaded Paul Willson's UI Mapper. One thing I can see with Paul's products are that they are flexible, so Wilson's UI Mapper doesn't require you to use his OR Mapper... From what I have read (nope I haven't used it yet) Wilson's UI Mapper uses an XML file to do the mapping (my bet is that you have a number of other ways of doing this too). It seems cool, but the control freak in me wants something else.
What I want is a CodeSmith Template that can build code.. my code... to do the OR Mapping. There's a lot to this. I'm thinking that another layer needs to be build (actually it's sort of the Controller pattern. -- I'm cool... I mentioned a pattern). The idea is that there would be a new set of classes to go between the UI and the Business Objects (and maybe also the data layer). Basically you would have a method where you would pass an instance of a form (web or win) and instruct the Controller layer to fill the form with data.
I will blog later about my ideas for implementing this with CodeSmith...
| posted on Wednesday, June 01, 2005 10:49 PM