views:

91

answers:

2

I'm looking for a 'complete' solution for code-generation based on DDD or model first approach. Ideally, this would be a separate application or VS plugin that we could use and re-use to generate as much of the standard plumbing code as possible, preserving my custom business logic as well.

I would like to generate VS projects, including WCF sercvice app, Data layer, entity model etc. and client applications such as ASP.MVC (and/or web-forms) sites with scaffolding, windows client.

I know there are many choices like Entity Framework vs NHibernate, open-source frameworks such as S#ahrp Architecture, and there are commercial products as well. I'm open to anything as I know most of the investment will be in time.

thanks in advance.


To add to this: The Entity Framework (4.0) is a big step forward as it will generate c# business classes as well as the database schema, allowing you to focus on the 'model', which is good. Is there anything that will go one level higher to allow generation of other objects based on a (meta)model of some kind.

thanks

+1  A: 

Hello,

I'd recommend taking a look at CodeSmith. It comes with several different template frameworks like PLINQO (Linq-to-SQL), NHibernate, CSLA and .netTiers (which sounds closer to what you are looking for).

Also take a look at the video tutorials on how to use the frameworks located here.

Thanks -Blake Niemyjski

Blake Niemyjski
Thanks Blake - I have looked into codesmith before, and it looks interesting, however it typically appears to be a database-first generation strategy - although I would be interested if it has some support for generation from a 'model' of some type.
Rob
+1  A: 

I understand that SparxEA (Enterprise Architect) supports code generation (and the generation of models from code) but I've never actually done that with it myself.

So this should definately allow you to model your system / domain and then generate appropriate code.

It also seems to support integration with Visual Studio: http://www.sparxsystems.com.au/products/mdg/int/vs/index.html

Adrian K
Thanks Adrian, I will look into EA more - I have used it somewhat, but was not sure of the code-generation strategy/techniques. I will check it out.
Rob