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.