Proto3:File Location - 文件位置

Prefer not to put .proto files in the same directory as other language sources. Consider creating a subpackage proto for .proto files, under the root package for your project.
如果不喜欢将.proto文件和其他语言资源放在同一个目录中。考虑在工程根包下为.proto文件创建一个子包proto。

Location Should be Language-agnostic

位置应与语言无关

When working with Java code, it's handy to put related .proto files in the same directory as the Java source. However, if any non-Java code ever uses the same protos, the path prefix will no longer make sense. So in general, put the protos in a related language-agnostic directory such as //myteam/mypackage.
使用Java代码时,将相关.proto文件和Java资源放在同一目录下是很方便的。然而,如何任何非Java代码使用相同proto,路径前缀将不再有意义。所以通常来说,将proto放入到与语言无关的目录中,如//myteam/mypackage.

The exception to this rule is when it's clear that the protos will be used only in a Java context, such as for testing.
这条规则的例外是当很明显原型将只在 Java 上下文中使用时,例如用于测试。

你可能感兴趣的:(Proto3:File Location - 文件位置)