问题是有代码生成器和对象关系映射器 (ORM) 以及执行对象关系映射的代码生成器。
NHibernate 之类的东西是纯的(ORM)并且不生成任何代码,它只是为您提供了一个对象持久层。
Llblgen 是一个代码生成器,它生成执行 ORM 功能的代码,但您实际上可以看到代码并可以用自定义行为覆盖它。Llblgen 不会为您生成您的 UI,它也不是为您设计的。它主要集中在数据访问上。
然后你有像 CodeSmith 这样的工具或 Visual Studio 附带的内置 T4 生成器,你可以使用它们来创建模板,然后它们会生成你想要的任何东西,只要你编写自己的模板。我曾为那些投入数千美元编写自己的模板的公司工作过。
Finally there are complete tools like CodeOnTime or IronSpeed which generate entire applications for you. This sounds good in theory, and is great for small CRUD type applications, but you lose a lot of flexibility with tools like these as they often have conventions which you are required to work around and once you start getting into heavy customization, tend to get in your way.
You should ask yourself:
- Do I just need something for accessing my data? if so, you could use an ORM
- Do I need to generate a highly customized UI? if so, you'd probably be best avoiding the tool like CodeOnTime and IronSpeed