Objective C 标准的类图?
我无法找到为 Objective C 应用程序绘制类图的标准方法。主要是:
- 我包含字段类型还是仅包含 var 名称?
- 我是否包含方法返回类型和参数?
谢谢你!
I'm having trouble finding the standard way a class diagram should be drawn for objective C applications. Mostly:
- Do I incude field types or just the var name?
- Do I include method return types and parameters?
Thank you!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我见过的许多 Objective-C 图不包含类型或参数。图中仅放置字段和方法名称。
但是,我强烈建议您包含所有这些信息,无论规范是什么。通过这样做,类图不仅对于建模有用,而且还可以用作文档。添加类型注释并不是特别困难,最终结果是类的更加完整(并且有用)的图片。
Many of the Objective-C diagrams I have seen do not include types or parameters. Only the field and method names are placed in the diagram.
However, I would strongly encourage you to include all this information, regardless of what the norm may be. By doing so, the class diagram is not only useful for modelling, but also serves as documentation. It's not particularly difficult to add the type annotations, and the end result is a far more complete (and useful) picture of the class.
记录它们的方式与使用任何其他面向对象语言记录类的方式相同。类属性应包括字段类型、属性名称和多重性。类方法应包括返回类型和参数。
Document them the same way you would document a class in any other object oriented language. Class properties should include the field type, property name and multiplicity. Class methods should include return types and parameters.