Reputation: 21
I'm trying to migrate some of our existing schema to OLP, using maven archetype. Is there any naming convention to what the package name should look like? We are debating wether it should be "com.here.hdlm.protobuf.schema" or "com.here.schema.hdlm.protobuf". Or maybe we should even skip protobuf from the name.
Thanks.
Upvotes: 1
Views: 198
Reputation: 460
HERE Artifact Service hosts only Protobuf Schemas. I would recommend not to use words 'protobuf' and 'schema' in the name as it is implied and makes the package name longer.
Protobuf Schema publishing documentation has a section connected to the naming: https://developer.here.com/olp/documentation/archetypes/dev_guide/topics/archetypes-best-practices.html
This is the content of the section:
Package Naming
You are prompted to define the group ID, artifact ID, and package name for your schema at the stage of generating a schema project. If you don't specify any package name, the group ID is used instead.
Group ID and artifact ID are used to generate the schema's HERE Resource Name (HRN) once you upload your schema to OLP. For example, the HRN of the HMC Building Footprints schema is hrn:here:schema:::com.here.schema.rib:building-footprints_v2:2.13.0.
The package name is used in the protobuf, Java, and Scala package names.
For group ID, use your company's reversed domain name, such as com.here.schema.rib.
For artifact ID, use a name specific to the type of schemas packaged in the project, such as building-footprints. Try to keep the artifact ID as short as possible.
Also, make sure that the major version of your schema is included in the name of your package. For example, version 2.3 should have v2 as part of its package name, such as: com.here.platform.schema.foo.v2. The presence of the major version in the package name is additionally verified by the Major Version in Package Validator.
We recommend following Java package naming conventions.
Upvotes: -1
Reputation: 36
You should definitely use the convention of placing the project name after the reversed internet domain and company name, https://docs.oracle.com/javase/tutorial/java/package/namingpkgs.html, i.e., "com.here.hdlm"
As to whether "protobuf.schema", "schema.protobuf" or skipping protobuf, it's up to you.
As an additional reference - https://developer.here.com/olp/documentation/data-user-guide/portal/schemas-creating.html
Upvotes: 0