建议Java注释订单? [英] Suggested Java annotation order?

查看:143
本文介绍了建议Java注释订单?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关大量使用Java注释的项目,是否有标注顺序什么建议吗?这样才能均匀球队code风格。

For projects heavily used of Java annotations, is there any suggestion on the annotation order? So as to uniform the code style in the team.

推荐答案

我会说有没有。我可以在这被证明是错误的。

I'm going to say there's not. I could be proven wrong on this.

我的理由是,有上百个项目有注释,除了烤成Java中的人,和那些烤到我们的IDE(Eclipse的特别,但我相信其他人有他们。)

My reasoning is there are hundreds of projects that have annotations, in addition to the ones baked into Java, and the ones baked into our IDEs (specifically Eclipse but I'm sure others have them too.)

因此​​,所有这些库可能competitng为上面的我怀疑他们会在一个标准达成一致。

So, with all these libraries potentially competitng for "whose on top" I doubt they would agree on a standard.

我会鼓励你的团队坐下来,对什么最适合你们的决定。

I would encourage your team to sit down and make decisions about what's best for you guys.

因素,我会考虑:


  1. 哪些annotatiosn是最重要的?它们应该是在顶部附近。

  2. 哪些注解是最有可能成为indicitive潜在的错误?它们应该是在顶部附近。

  3. 注释哪些可能是在类的所有方法?它们应该在底部附近。

这篇关于建议Java注释订单?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆