以语言中立的方式表示类和接口

发布于 2024-09-13 22:06:35 字数 292 浏览 4 评论 0原文

我需要以语言中立的方式定义简单的类和接口(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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

注定孤独终老 2024-09-20 22:06:35

我想您可能正在寻找 XMI (XML 元数据交换)

I think you might be looking for XMI (XML Metadata Interchange)

腹黑女流氓 2024-09-20 22:06:35

有 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.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文