以语言中立的方式表示类和接口
我需要以语言中立的方式定义简单的类和接口(Ex. IClassInterface),然后使用各种代码生成工具生成各种语言(例如 C#、Java、等等...有谁知道标准;批准或以其他方式;我可以将其用于中立表示。我知道 UML 通常用于创建图表,但我实际上正在寻找可以轻松解析、扩展并用于驱动其他自动化流程的东西。也许这实际上可以通过 UML 实现,尽管我不确定标记语言如果存在的话会是什么样子。
我可以使用 XML 或类似的东西创建自己的定义,但如果可能的话,我宁愿避免重新发明轮子。
I need to define simple classes and interfaces (Ex. IClassInterface) in a language neutral way and then use a variety of code generation tools to generate the code files in a variety of languages such as C#, Java, etc... Does anyone know of a standard; ratified or otherwise; that I can use for the neutral representation. I know UML is often used for creating diagrams, but I am actually looking for something that can easily be parsed, extended, and used to drive other automated processes. Maybe this is actually possible with UML, although I am not sure what the markup language might look like if one exists.
I could create my own definition using XML or something similar, but I would prefer to avoid reinventing the wheel if possible.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
UML
UML
我想您可能正在寻找 XMI (XML 元数据交换)
I think you might be looking for XMI (XML Metadata Interchange)
有 IDL(例如 Google 的 协议缓冲区)和 WSDL,许多 Web 服务框架可以使用它来生成接口和类。 (您通常不必将生成的代码用作实际的 Web 服务。)
IDL 列出了 IDL 的许多实现。虽然IDL主要用于描述接口,但一些实现也使用它来描述对象(例如Microsoft IDL。)
There is IDL (for example, Google's protocol buffers), and WSDL, which can be used to produce interfaces and classes by many web service frameworks. (You typically do not have to use the generated code as an actual webservice.)
The wikipedia entry for IDL lists a number of implementations of IDL. Although IDL is mainly for describing interfaces, some implementations also use it to describe objects (e.g. Microsoft IDL.)