Creating Data Transfer Objects (DTO) with CodeSmith
I’ve created a template for CodeSmith to create Data Transfer Objects automatically by simply supplying the path and file to your domain model assembly file. This assembly should have all your business objects included. The template does the rest. I only spent two days on this but it works for the most part including generics. It basically uses reflection to create a DTO version of each business class.
I was going to extend it by using Attributes to decorate class names as well as properties for your domain model; but, found that this current version fits my need at the moment.
Feel free to extend and enhance it. Let me know if you create a new version so that I can enjoy that as well.
You can download the file here.
UPDATE 07-15-2006: I have updated the template to support Enums. I also created a console app so that you can call this during your build process.
8 Comments »
Leave a comment
-
Archives
- November 2009 (1)
- September 2008 (2)
- August 2008 (4)
- June 2008 (1)
- April 2008 (1)
- September 2007 (1)
- August 2007 (1)
- April 2007 (2)
- January 2007 (1)
- December 2006 (1)
- July 2006 (3)
-
Categories
-
RSS
Entries RSS
Comments RSS

[...] Creating Data Transfer Objects (DTO) with CodeSmith. Templates available for download. [...]
Pingback by Community Server Daily News : Community Server Daily News for Friday, July 14, 2006 | July 14, 2006 |
[...] Creating Data Transfer Objects (DTO) with CodeSmith Creating Data Transfer Objects (DTO) with CodeSmith. Templates available for download. Published Friday, July 14, 2006 12:30 PM by daveburke [...]
Pingback by Daily News Faq List : Creating Data Transfer Objects (DTO) with CodeSmith | November 22, 2006 |
[...] Data Transfer Objects (DTO) with CodeSmith Creating Data Transfer Objects (DTO) with CodeSmith. Templates available for download. Published Friday, July 14, 2006 11:30 AM by [...]
Pingback by Community Server Bits : Creating Data Transfer Objects (DTO) with CodeSmith | March 12, 2007 |
hi,
I cant access your template. is it possible for you to publish it again? I dont see it in yahoo briefcase, its empty!
thanks
vivek
Hmm, strange. I was able to download all files just fine. Do you still have a problem? If so, I’ll put the files to a different store.
Need to talk to you. Happy to see you are doing well.
Carlos
Carlos,
If you are who I think you are, you can send me an email to thomasjaeger at gmail dot com.
Ditto on the empty Yahoo folder when clicking on the link in the article. Can you post the template somewhere else? Thanks.