I've used MyGeneration, and I love it for generating code that uses Data Access Applicaiton Blocks from Microsoft for my Data Access Layer, and keeping my database concepts in sync with the domain I am modeling. Although, it took a steeper than expected learning curve one weekend to make it productive.
我使用MyGeneration,我喜欢它生成的代码使用来自微软的数据访问应用程序块作为我的数据访问层,并使我的数据库概念与我正在建模的领域保持同步。尽管如此,一个周末的学习曲线比预期的要陡峭得多。
I'm wondering what others are doing related to code generation.
我想知道其他人在做什么与代码生成相关的事情。
http://www.mygenerationsoftware.com
http://www.mygenerationsoftware.com
http://www.codesmithtools.com/
http://www.codesmithtools.com/
Others?
其他人呢?
Back in 2000, or so, the company I worked for used a product from Veritas Software (I believe it was) to model components and generate code that integrated components (dlls). I didn't get a lot of experience with it, but it seems that code generation has been the "holy grail" for a long time. Is it practical? How are others using it?
早在2000年左右,我工作的公司就使用了Veritas软件(我相信是这样)的产品来建模组件,并生成集成组件(dll)的代码。我并没有得到太多的经验,但是看起来代码生成已经是很长时间的“圣杯”了。它是实用吗?其他人如何使用它?
Thanks!
谢谢!
27 个解决方案
#1
8
T4 is the CodeSmith killer for Microsoft!!!!
T4是微软的CodeSmith杀手!!!!
Go check it out. Microsoft doesn't want to destroy their partners so they don't advertise it, but it is a thing to be reckoned with and ITS FREE and comes installed in Visual Studio 2008.
去看看吧。微软不想毁掉他们的合作伙伴,所以他们不做广告,但这是一件需要认真对待的事情,它是免费的,安装在Visual Studio 2008中。
www.olegsych.com
codeplex.com/t4toolbox
www.t4editor.net
#2
3
I have used LLBLGen and nHibernate successfully to generate Entity and DAL layers.
我已经成功地使用LLBLGen和nHibernate来生成实体层和DAL层。
#3
2
We use Codesmith and have had great success with it. I am now constantly trying to find where we can implement templates to speed up mundane processes.
我们使用了Codesmith,并取得了巨大的成功。我现在一直在寻找我们可以在哪里实现模板来加速日常的过程。
#4
1
I've done work with CSLA and used codesmith to generate my code using the CSLA templates.
我已经使用CSLA完成了工作,并使用codesmith使用CSLA模板生成代码。
codesmithtools.com
codesmithtools.com
#5
1
If your database is your model, SubSonic has an excellent code generator that as of v2.1, no longer requires ActiveRecord (you can use the Repository Pattern instead). It's less flexible than others, but there are customizations that can be made in the stock templates.
如果您的数据库是您的模型,亚音速有一个优秀的代码生成器,如v2.1,不再需要ActiveRecord(您可以使用存储库模式)。它不像其他的那样灵活,但是可以在股票模板中进行定制。
#6
1
I have used CodeSmith and MyGeneration, wasn't overly keen on either, felt somewhat terse to use, learning template languages etc.
我用过CodeSmith和MyGeneration,都不太喜欢,感觉有点简洁,学习模板语言等等。
SubSonic is what we sometimes use here to generate a Data Access Layer. Used in the right size projects, it is a fantastic time saving tool. clicky
亚音速是我们在这里用来生成数据访问层的东西。在合适的项目中使用,这是一个极好的节省时间的工具。滴答的
#7
1
I see code generation harmfull as well, but only if you use 3rd party tools like codesmith and mygeneration. I have 2 stored procedures that generate my domain objects and domain interfaces
我认为代码生成也有危害,但前提是您必须使用像codesmith和mygeneration这样的第三方工具。我有两个存储过程,它们生成我的域对象和域接口。
Example
例子
GenerateDomainInterface 'TableName'
GenerateDomainInterface“表”
Then I just copy and paste it into visual studio. Works pretty awesome for those tasks I hate to do.
然后复制粘贴到visual studio中。对于那些我不喜欢做的任务来说,它非常棒。
#8
1
Two framworks I use often.
我经常使用的两个框架。
Ragel
Something worth checking out is Ragel. It's used to generate code for state machines.
Ragel是值得一看的。它用于为状态机生成代码。
You just add some simple markup to your source code, then run a generator on Ragel generates code for C, C++, Objective-C, D, Java and Ruby, and it's easy to mix it with your regular source.
您只需在源代码中添加一些简单的标记,然后在Ragel上运行一个生成器,生成C、c++、Objective-C、D、Java和Ruby的代码,并且很容易将它与您的常规源混合。
Ragel even allow you to execute code on state transitions and such. It makes it easy to create file format and protocol parsers.
Ragel甚至允许您对状态转换等执行代码。它使创建文件格式和协议解析器变得容易。
Some notable projects that user Ragel are, Mongrel, a great ruby web server. And Hpricot, a ruby based html-parser, sort of inspired by jQuery.
一些值得注意的项目是用户Ragel, Mongrel,一个很棒的ruby web服务器。Hpricot是一个基于ruby的html解析器,它受到了jQuery的启发。
Another great feature of Ragel is how it can generate graphviz-based charts that visualize your state machines. Below is an example taken from Zed Shaw's article on ragel state charts.
Ragel的另一个重要特性是它如何生成基于图形的图表来可视化您的状态机。下面是泽德·肖关于拉格尔状态图的文章中的一个例子。
Ragel State Chart http://www.zedshaw.com/tips/HelloMachine_small.png
http://www.zedshaw.com/tips/HelloMachine_small.png Ragel状态表
XMLBeans
XMLBeans is a java-based xml-binding. It's got a great workflow and I use it often.
XMLBeans是一种基于java的xml绑定。它有一个很棒的工作流,我经常使用它。
XMLBeans processen an xml-schema that describes your model, into a set of java-classes that represents that model. You can programmatically create models then serialise them to and from xml.
XMLBeans将描述模型的xml模式处理为一组表示该模型的java类。您可以以编程方式创建模型,然后将它们序列化到xml或从xml序列化到xml。
#9
0
I have used CodeSmith. Was pretty helpful.
我用CodeSmith。很有帮助。
#10
0
I love to use SubSonic. Open source is the way to go with code generation I think because it is very easy to modify the templates and the core as they always tend to have bugs or one or two things you want to do that is not built in.
我喜欢用亚音速。我认为开源是代码生成的一种方式,因为修改模板和核心非常容易,因为它们往往会有bug,或者有一两件事情你想做,但却没有内置。
#11
0
I've used code generation for swizzle functions in a vector math library. I used a custom PERL script for it. None of the FLOSS generators I looked at seemed well-suited to creating swizzle functions
我在向量数学库中使用了用于swizzle函数的代码生成。我为它使用了一个自定义PERL脚本。我所看到的FLOSS生成器似乎都不适合创建swizzle函数
I generally use C++ templates, rather than code generation.
我通常使用c++模板,而不是代码生成。
#12
0
I've primarily used LLBLGen Pro to generate code. It offers a variety of patterns to use for generation and you can supply your own patters, just like CodeSmith. The customer support has been excellent.
我主要使用LLBLGen Pro生成代码。它提供了多种用于生成的模式,您可以提供自己的模式,就像CodeSmith一样。客户支持非常好。
Essentially, I generate my business objects and DAL using LLBLGen and keep them up to date. The code templates have sections where you can add your own logic that won't be wiped out during regeneration. It's definitely worth taking a look.
本质上,我使用LLBLGen生成业务对象和DAL,并使它们保持最新。代码模板包含一些部分,您可以在其中添加自己的逻辑,在更新过程中不会被删除。这绝对值得一看。
#13
0
We custom build our code generation using linq and XML literals (VB). We haven't found a way to break the solutions into templates yet; however, those two technologies make this task so trivial, I don't think we will.
我们使用linq和XML文字(VB)定制代码生成。我们还没有找到将解决方案分解为模板的方法;然而,这两种技术使这个任务变得如此琐碎,我认为我们不会。
#14
0
I'd consider code generation harmful as it bloats the codebase without adding new logic or insight. Ideally one should raise the level of abstraction, use data files, templates or macros etc. to avoid generating large amounts of boiler plate code. It helps you get things done quickly but can hurt maintainability in the long run.
我认为代码生成是有害的,因为它会在没有添加新的逻辑或洞察力的情况下膨胀代码基。理想情况下,应该提高抽象级别,使用数据文件、模板或宏等来避免生成大量的锅炉板代码。它可以帮助您快速地完成任务,但从长远来看会损害可维护性。
If your chosen programming language becomes much less painful by generating it from some template language, that seems indicate you'd save even more time by doing the higher level work in another, perhaps more dynamic language. YMMV.
如果您所选择的编程语言通过某种模板语言生成变得不那么痛苦,这似乎表明您可以通过使用另一种更动态的语言进行更高级别的工作来节省更多的时间。YMMV。
#15
0
LLBLGen Pro is an excellent tool which allows you to write a database agnostic solution. It's really quick to pick up the basic features. Advanced features aren't much more challenging. I highly recommend you check it out.
LLBLGen Pro是一个优秀的工具,它允许您编写一个与数据库无关的解决方案。它能很快地识别出基本的特征。高级特性并不是更具有挑战性。我强烈推荐你去看看。
#16
0
I worked for four years as the main developer in a web agency, as I wrote from ground-up my first two or three websites, I soon realized that it was going to be a very boring task to do it all the times. So I started writing my own web site generator engine.
我在一家网络公司做了四年的主要开发人员,当我刚开始写两三家网站的时候,我很快就意识到,要一直做下去将是一项非常枯燥的任务。于是我开始编写自己的网站生成器引擎。
My starting point was this site http://www.codegeneration.net/. I took one of their examples for a simple crud generation and extended to the level that i was generating entire sites with it.
我的出发点是这个网站http://www.codegener.net/。我举了一个简单的crud生成的例子,并扩展到我用它生成整个站点的水平。
I used xml for the definition of various parts of the website (pages, datalists, joins, tables, form management). The generated web sites were completely detached from the generator, so the generated website could also be modified by hand.
我使用xml定义网站的各个部分(页面、数据表、连接、表、表单管理)。生成的web站点完全与生成器分离,因此也可以手工修改生成的web站点。
Here is their article http://www.codegeneration.net/tiki-read_article.php?articleId=19.
这里是他们的文章http://www.codegener.net/tiki -read_article.php?
#17
0
I've done several one-off's of code generation using Castor to create Java source code based on XSD's. The latest use was to create Java classes for an Open Travel Association implementation. The OTA Schema is pretty hairy and would have been a bear to do by hand. Castor did a pretty good job given the complexity of the schema.
我已经使用Castor完成了一些一次性的代码生成,以基于XSD创建Java源代码。最新的用途是为开放旅游协会的实现创建Java类。OTA模式是相当复杂的,如果是用手来做的话,那就太麻烦了。由于模式的复杂性,Castor做得非常好。
#18
0
Python。
I have used MyGeneration which uses C# to write your code templates. However, I started using Python and I found that I can write code that generates other code faster in that language than I would if written in C#. Subsequently, I have used Python to code gen C#, TSQL, and VB.
我使用了MyGeneration,它使用c#来编写代码模板。但是,我开始使用Python,我发现我可以编写用这种语言生成其他代码的代码,比用c#更快。随后,我使用Python编写了gen c#、TSQL和VB。
Generally, code that generates other code tends to be harder to follow by its very nature. Python's cleaner syntax helps tremendously by making it more readable and more maintainable than the equivalent in C#.
通常,生成其他代码的代码往往很难遵循它的本质。与c#中的等效语法相比,Python更清晰的语法使其更易于阅读和维护,这对Python有极大的帮助。
#19
0
codesmith for .net
codesmith为。net
#20
0
I wrote a utility where you specify a table and it generates an Oracle trigger which records all changes to that table. Makes logging really simple.
我编写了一个实用程序,您在其中指定一个表,它生成一个Oracle触发器,该触发器记录对该表的所有更改。使日志很简单。
There's another one I wrote that generates a Delphi class that models any database table you give it, but I consider it a code smell to do that, so I rarely use it.
我还编写了另一个函数,它生成一个Delphi类,可以为您提供的任何数据库表建模,但我认为这是一种代码味道,所以我很少使用它。
#21
0
At the company we've written our own to generate most of our entity/dalc/business classes and the related stored procedures as it took only a little time and we had some special requirements. Although I'm sure we could've achieved the same thing using an existing generator, it was a fun little project to work on.
在公司,我们已经编写了自己的代码来生成大部分的实体/dalc/业务类和相关的存储过程,因为它只花费了很少的时间,并且我们有一些特殊的需求。虽然我确信我们可以使用现有的生成器实现同样的目标,但这是一个有趣的小项目。
Codesmith's been recommended by many people and it does seem to be a good one. Personally all I need from a code generator is to make it easy to amend templates.
Codesmith已经被很多人推荐了,看起来是一个不错的选择。就我个人而言,我所需要的代码生成器是使修改模板变得容易。
#22
0
I use the hibernate tools in myEclipse to generate domain models and DAO code from my data model. It seems to work pretty well (there are some issues if you write custom methods in your DAO's, these seem to get lost on over-writes), but generally it seems to work pretty well- especially in conjunction with Spring.
我使用myEclipse中的hibernate工具从我的数据模型生成域模型和DAO代码。它似乎运行得很好(如果您在DAO中编写自定义方法,那么会有一些问题,这些方法似乎会在重写时丢失),但是通常它似乎运行得很好——尤其是与Spring结合使用时。
#23
0
SubSonic is great!! The query capability is easy to grasp, and the stored procedure implementation is truly awesome. I could go on and on. It makes you productive instantly.
亚音速很棒! !查询功能很容易掌握,而且存储过程的实现非常棒。我可以继续下去。它能让你立刻变得高效。
#24
0
I mainly code in C# and when i need code generation I do it in XLST when the source could be simply converted to XML or a ruby script when it's more complex.
我主要用c#编写代码,当需要生成代码时,我在XLST中编写代码,当源代码更复杂时,可以简单地转换为XML或ruby脚本。
If the code generation part need frequent modifications by more than a few developers CodeSmith works pretty well (And is easier to learn than XSLT or ruby by new developers).
如果代码生成部分需要超过几个开发人员的频繁修改,那么CodeSmith就会运行得很好(并且比新开发人员学习XSLT或ruby更容易)。
#25
0
Outsystems' Agile Platform can be used to generate open source, well documented C# and Java applications. Because it has also several features related to deploying, managing and changing, most people end up using it not just to generate the code but actually to manage the full life-cycle of web applications.
Outsystems的敏捷平台可以用来生成开源的、有良好文档记录的c#和Java应用程序。因为它还具有与部署、管理和更改相关的几个特性,因此大多数人最终使用它不仅仅是生成代码,而且实际上是管理web应用程序的整个生命周期。
#26
0
For some time, I've used a home-grown script/template language for code generation. (I've used that languge mostly for no other reason than to find use for my little pet project)
一段时间以来,我使用了一个自定义的脚本/模板语言来生成代码。(我用这种语言主要是为了给我的小宠物项目找点用处。)
Recently, I've created some SQL*PLUS scripts to create database access code (no Hibernate for us...)
最近,我创建了一些SQL*PLUS脚本来创建数据库访问代码(我们没有Hibernate…)
#27
0
MyGeneration all the way!
MyGeneration一路!
MyGeneration is an extremely flexible template based code generator written in Microsoft.NET. MyGeneration is great at generating code for ORM architectures. The meta-data from your database is made available to the templates through the MyMeta API.
MyGeneration是一个非常灵活的基于模板的在Microsoft.NET中编写的代码生成器。MyGeneration擅长为ORM架构生成代码。数据库中的元数据通过MyMeta API提供给模板。
#1
8
T4 is the CodeSmith killer for Microsoft!!!!
T4是微软的CodeSmith杀手!!!!
Go check it out. Microsoft doesn't want to destroy their partners so they don't advertise it, but it is a thing to be reckoned with and ITS FREE and comes installed in Visual Studio 2008.
去看看吧。微软不想毁掉他们的合作伙伴,所以他们不做广告,但这是一件需要认真对待的事情,它是免费的,安装在Visual Studio 2008中。
www.olegsych.com
codeplex.com/t4toolbox
www.t4editor.net
#2
3
I have used LLBLGen and nHibernate successfully to generate Entity and DAL layers.
我已经成功地使用LLBLGen和nHibernate来生成实体层和DAL层。
#3
2
We use Codesmith and have had great success with it. I am now constantly trying to find where we can implement templates to speed up mundane processes.
我们使用了Codesmith,并取得了巨大的成功。我现在一直在寻找我们可以在哪里实现模板来加速日常的过程。
#4
1
I've done work with CSLA and used codesmith to generate my code using the CSLA templates.
我已经使用CSLA完成了工作,并使用codesmith使用CSLA模板生成代码。
codesmithtools.com
codesmithtools.com
#5
1
If your database is your model, SubSonic has an excellent code generator that as of v2.1, no longer requires ActiveRecord (you can use the Repository Pattern instead). It's less flexible than others, but there are customizations that can be made in the stock templates.
如果您的数据库是您的模型,亚音速有一个优秀的代码生成器,如v2.1,不再需要ActiveRecord(您可以使用存储库模式)。它不像其他的那样灵活,但是可以在股票模板中进行定制。
#6
1
I have used CodeSmith and MyGeneration, wasn't overly keen on either, felt somewhat terse to use, learning template languages etc.
我用过CodeSmith和MyGeneration,都不太喜欢,感觉有点简洁,学习模板语言等等。
SubSonic is what we sometimes use here to generate a Data Access Layer. Used in the right size projects, it is a fantastic time saving tool. clicky
亚音速是我们在这里用来生成数据访问层的东西。在合适的项目中使用,这是一个极好的节省时间的工具。滴答的
#7
1
I see code generation harmfull as well, but only if you use 3rd party tools like codesmith and mygeneration. I have 2 stored procedures that generate my domain objects and domain interfaces
我认为代码生成也有危害,但前提是您必须使用像codesmith和mygeneration这样的第三方工具。我有两个存储过程,它们生成我的域对象和域接口。
Example
例子
GenerateDomainInterface 'TableName'
GenerateDomainInterface“表”
Then I just copy and paste it into visual studio. Works pretty awesome for those tasks I hate to do.
然后复制粘贴到visual studio中。对于那些我不喜欢做的任务来说,它非常棒。
#8
1
Two framworks I use often.
我经常使用的两个框架。
Ragel
Something worth checking out is Ragel. It's used to generate code for state machines.
Ragel是值得一看的。它用于为状态机生成代码。
You just add some simple markup to your source code, then run a generator on Ragel generates code for C, C++, Objective-C, D, Java and Ruby, and it's easy to mix it with your regular source.
您只需在源代码中添加一些简单的标记,然后在Ragel上运行一个生成器,生成C、c++、Objective-C、D、Java和Ruby的代码,并且很容易将它与您的常规源混合。
Ragel even allow you to execute code on state transitions and such. It makes it easy to create file format and protocol parsers.
Ragel甚至允许您对状态转换等执行代码。它使创建文件格式和协议解析器变得容易。
Some notable projects that user Ragel are, Mongrel, a great ruby web server. And Hpricot, a ruby based html-parser, sort of inspired by jQuery.
一些值得注意的项目是用户Ragel, Mongrel,一个很棒的ruby web服务器。Hpricot是一个基于ruby的html解析器,它受到了jQuery的启发。
Another great feature of Ragel is how it can generate graphviz-based charts that visualize your state machines. Below is an example taken from Zed Shaw's article on ragel state charts.
Ragel的另一个重要特性是它如何生成基于图形的图表来可视化您的状态机。下面是泽德·肖关于拉格尔状态图的文章中的一个例子。
Ragel State Chart http://www.zedshaw.com/tips/HelloMachine_small.png
http://www.zedshaw.com/tips/HelloMachine_small.png Ragel状态表
XMLBeans
XMLBeans is a java-based xml-binding. It's got a great workflow and I use it often.
XMLBeans是一种基于java的xml绑定。它有一个很棒的工作流,我经常使用它。
XMLBeans processen an xml-schema that describes your model, into a set of java-classes that represents that model. You can programmatically create models then serialise them to and from xml.
XMLBeans将描述模型的xml模式处理为一组表示该模型的java类。您可以以编程方式创建模型,然后将它们序列化到xml或从xml序列化到xml。
#9
0
I have used CodeSmith. Was pretty helpful.
我用CodeSmith。很有帮助。
#10
0
I love to use SubSonic. Open source is the way to go with code generation I think because it is very easy to modify the templates and the core as they always tend to have bugs or one or two things you want to do that is not built in.
我喜欢用亚音速。我认为开源是代码生成的一种方式,因为修改模板和核心非常容易,因为它们往往会有bug,或者有一两件事情你想做,但却没有内置。
#11
0
I've used code generation for swizzle functions in a vector math library. I used a custom PERL script for it. None of the FLOSS generators I looked at seemed well-suited to creating swizzle functions
我在向量数学库中使用了用于swizzle函数的代码生成。我为它使用了一个自定义PERL脚本。我所看到的FLOSS生成器似乎都不适合创建swizzle函数
I generally use C++ templates, rather than code generation.
我通常使用c++模板,而不是代码生成。
#12
0
I've primarily used LLBLGen Pro to generate code. It offers a variety of patterns to use for generation and you can supply your own patters, just like CodeSmith. The customer support has been excellent.
我主要使用LLBLGen Pro生成代码。它提供了多种用于生成的模式,您可以提供自己的模式,就像CodeSmith一样。客户支持非常好。
Essentially, I generate my business objects and DAL using LLBLGen and keep them up to date. The code templates have sections where you can add your own logic that won't be wiped out during regeneration. It's definitely worth taking a look.
本质上,我使用LLBLGen生成业务对象和DAL,并使它们保持最新。代码模板包含一些部分,您可以在其中添加自己的逻辑,在更新过程中不会被删除。这绝对值得一看。
#13
0
We custom build our code generation using linq and XML literals (VB). We haven't found a way to break the solutions into templates yet; however, those two technologies make this task so trivial, I don't think we will.
我们使用linq和XML文字(VB)定制代码生成。我们还没有找到将解决方案分解为模板的方法;然而,这两种技术使这个任务变得如此琐碎,我认为我们不会。
#14
0
I'd consider code generation harmful as it bloats the codebase without adding new logic or insight. Ideally one should raise the level of abstraction, use data files, templates or macros etc. to avoid generating large amounts of boiler plate code. It helps you get things done quickly but can hurt maintainability in the long run.
我认为代码生成是有害的,因为它会在没有添加新的逻辑或洞察力的情况下膨胀代码基。理想情况下,应该提高抽象级别,使用数据文件、模板或宏等来避免生成大量的锅炉板代码。它可以帮助您快速地完成任务,但从长远来看会损害可维护性。
If your chosen programming language becomes much less painful by generating it from some template language, that seems indicate you'd save even more time by doing the higher level work in another, perhaps more dynamic language. YMMV.
如果您所选择的编程语言通过某种模板语言生成变得不那么痛苦,这似乎表明您可以通过使用另一种更动态的语言进行更高级别的工作来节省更多的时间。YMMV。
#15
0
LLBLGen Pro is an excellent tool which allows you to write a database agnostic solution. It's really quick to pick up the basic features. Advanced features aren't much more challenging. I highly recommend you check it out.
LLBLGen Pro是一个优秀的工具,它允许您编写一个与数据库无关的解决方案。它能很快地识别出基本的特征。高级特性并不是更具有挑战性。我强烈推荐你去看看。
#16
0
I worked for four years as the main developer in a web agency, as I wrote from ground-up my first two or three websites, I soon realized that it was going to be a very boring task to do it all the times. So I started writing my own web site generator engine.
我在一家网络公司做了四年的主要开发人员,当我刚开始写两三家网站的时候,我很快就意识到,要一直做下去将是一项非常枯燥的任务。于是我开始编写自己的网站生成器引擎。
My starting point was this site http://www.codegeneration.net/. I took one of their examples for a simple crud generation and extended to the level that i was generating entire sites with it.
我的出发点是这个网站http://www.codegener.net/。我举了一个简单的crud生成的例子,并扩展到我用它生成整个站点的水平。
I used xml for the definition of various parts of the website (pages, datalists, joins, tables, form management). The generated web sites were completely detached from the generator, so the generated website could also be modified by hand.
我使用xml定义网站的各个部分(页面、数据表、连接、表、表单管理)。生成的web站点完全与生成器分离,因此也可以手工修改生成的web站点。
Here is their article http://www.codegeneration.net/tiki-read_article.php?articleId=19.
这里是他们的文章http://www.codegener.net/tiki -read_article.php?
#17
0
I've done several one-off's of code generation using Castor to create Java source code based on XSD's. The latest use was to create Java classes for an Open Travel Association implementation. The OTA Schema is pretty hairy and would have been a bear to do by hand. Castor did a pretty good job given the complexity of the schema.
我已经使用Castor完成了一些一次性的代码生成,以基于XSD创建Java源代码。最新的用途是为开放旅游协会的实现创建Java类。OTA模式是相当复杂的,如果是用手来做的话,那就太麻烦了。由于模式的复杂性,Castor做得非常好。
#18
0
Python。
I have used MyGeneration which uses C# to write your code templates. However, I started using Python and I found that I can write code that generates other code faster in that language than I would if written in C#. Subsequently, I have used Python to code gen C#, TSQL, and VB.
我使用了MyGeneration,它使用c#来编写代码模板。但是,我开始使用Python,我发现我可以编写用这种语言生成其他代码的代码,比用c#更快。随后,我使用Python编写了gen c#、TSQL和VB。
Generally, code that generates other code tends to be harder to follow by its very nature. Python's cleaner syntax helps tremendously by making it more readable and more maintainable than the equivalent in C#.
通常,生成其他代码的代码往往很难遵循它的本质。与c#中的等效语法相比,Python更清晰的语法使其更易于阅读和维护,这对Python有极大的帮助。
#19
0
codesmith for .net
codesmith为。net
#20
0
I wrote a utility where you specify a table and it generates an Oracle trigger which records all changes to that table. Makes logging really simple.
我编写了一个实用程序,您在其中指定一个表,它生成一个Oracle触发器,该触发器记录对该表的所有更改。使日志很简单。
There's another one I wrote that generates a Delphi class that models any database table you give it, but I consider it a code smell to do that, so I rarely use it.
我还编写了另一个函数,它生成一个Delphi类,可以为您提供的任何数据库表建模,但我认为这是一种代码味道,所以我很少使用它。
#21
0
At the company we've written our own to generate most of our entity/dalc/business classes and the related stored procedures as it took only a little time and we had some special requirements. Although I'm sure we could've achieved the same thing using an existing generator, it was a fun little project to work on.
在公司,我们已经编写了自己的代码来生成大部分的实体/dalc/业务类和相关的存储过程,因为它只花费了很少的时间,并且我们有一些特殊的需求。虽然我确信我们可以使用现有的生成器实现同样的目标,但这是一个有趣的小项目。
Codesmith's been recommended by many people and it does seem to be a good one. Personally all I need from a code generator is to make it easy to amend templates.
Codesmith已经被很多人推荐了,看起来是一个不错的选择。就我个人而言,我所需要的代码生成器是使修改模板变得容易。
#22
0
I use the hibernate tools in myEclipse to generate domain models and DAO code from my data model. It seems to work pretty well (there are some issues if you write custom methods in your DAO's, these seem to get lost on over-writes), but generally it seems to work pretty well- especially in conjunction with Spring.
我使用myEclipse中的hibernate工具从我的数据模型生成域模型和DAO代码。它似乎运行得很好(如果您在DAO中编写自定义方法,那么会有一些问题,这些方法似乎会在重写时丢失),但是通常它似乎运行得很好——尤其是与Spring结合使用时。
#23
0
SubSonic is great!! The query capability is easy to grasp, and the stored procedure implementation is truly awesome. I could go on and on. It makes you productive instantly.
亚音速很棒! !查询功能很容易掌握,而且存储过程的实现非常棒。我可以继续下去。它能让你立刻变得高效。
#24
0
I mainly code in C# and when i need code generation I do it in XLST when the source could be simply converted to XML or a ruby script when it's more complex.
我主要用c#编写代码,当需要生成代码时,我在XLST中编写代码,当源代码更复杂时,可以简单地转换为XML或ruby脚本。
If the code generation part need frequent modifications by more than a few developers CodeSmith works pretty well (And is easier to learn than XSLT or ruby by new developers).
如果代码生成部分需要超过几个开发人员的频繁修改,那么CodeSmith就会运行得很好(并且比新开发人员学习XSLT或ruby更容易)。
#25
0
Outsystems' Agile Platform can be used to generate open source, well documented C# and Java applications. Because it has also several features related to deploying, managing and changing, most people end up using it not just to generate the code but actually to manage the full life-cycle of web applications.
Outsystems的敏捷平台可以用来生成开源的、有良好文档记录的c#和Java应用程序。因为它还具有与部署、管理和更改相关的几个特性,因此大多数人最终使用它不仅仅是生成代码,而且实际上是管理web应用程序的整个生命周期。
#26
0
For some time, I've used a home-grown script/template language for code generation. (I've used that languge mostly for no other reason than to find use for my little pet project)
一段时间以来,我使用了一个自定义的脚本/模板语言来生成代码。(我用这种语言主要是为了给我的小宠物项目找点用处。)
Recently, I've created some SQL*PLUS scripts to create database access code (no Hibernate for us...)
最近,我创建了一些SQL*PLUS脚本来创建数据库访问代码(我们没有Hibernate…)
#27
0
MyGeneration all the way!
MyGeneration一路!
MyGeneration is an extremely flexible template based code generator written in Microsoft.NET. MyGeneration is great at generating code for ORM architectures. The meta-data from your database is made available to the templates through the MyMeta API.
MyGeneration是一个非常灵活的基于模板的在Microsoft.NET中编写的代码生成器。MyGeneration擅长为ORM架构生成代码。数据库中的元数据通过MyMeta API提供给模板。