official name restriction question

From the docs:

"…The name must:

Start with com.. For example, one of the official Unity packages is “com.unity.timeline”. …"

If I’m releasing an open source project under my own name rather than my company’s, what am I supposed to do? Name it com.baste.myPackage?

2 Likes

The naming uses “reverse domain name notation”, and in the best cases, the matching domain name belongs to the same entity as the package author (i.e. “baste.com” should not belong to someone else than you), but this is convention, not a strong requirement.

Strictly speaking, “com.baste” is a valid option. However for an open-source projects it’s common to see the domain names end with “.org”, so it might make more sense to use “org.baste” (or any other name you think would fit the “organization” that will end up owning the project).

What if there is no domain name and/or organization?

Let’s say I publish a package “Abc” at github/bitbucket mostly for personal use but don’t mind if other people use it too. What its name should be?

  • com.alexzzzz.abc (alexzzzz.com domain doesn’t exist)
  • alexzzzz.abc
  • abc
  • …?

Is it like a namespace in C# where the name is just an identifier that better be unique, but doesn’t really mean anything?

maybe com.github.alexzzzz.abc (if it’s hosted on github)

the difference with c# namespaces is that you cannot ever have 2 packages with the same name in a given project or registry, while you can handle conflicting namespaces (in different assemblies) with extern alias