Ever been in a situation where you’re getting hard time naming the package of your code? For me its always, probably because I do have partial OCD/OCPD (Obsessive Compulsive Personality Disorder)1.
Anyways, I’ve found this answer before on StackExchange hopefully its still there and I’m using it ever since in naming my namespaces and packages.
It’s double the giggles and double the grins, and double the trouble if you’re blessed with twins.
Just in-case it might get deleted here is the full answer:
Use the plural for packages with homogeneous contents and the singular for packages with heterogeneous contents.
A class is similar to a database relation. A database relation should be named in the singular as its records are considered to be instances of the relation. The function of a relation is to compose a complex record from simple data.
A package, on the other hand, is not a data abstraction. It assists with organization of code and resolution of naming conflicts. If a package is named in the singular, it doesn’t mean that each member of the package is an instance of the package; it contains related but heterogeneous concepts. If it is named in the plural (as they often are), I would expect that the package contains homogeneous concepts.
For example, a type should be named
TaskCollection instead of
TasksCollection, as it is a collection containing instances of a
Task. A package named
com.myproject.task does not mean that each contained class is an instance of a task. There might be a
TaskFactory, etc. A package named
com.myproject.tasks, however, would contain different types that are all tasks:
Here is the original answer link from Software Engineering StackExchange.
Should package names be singular or plural?
Check the original answer on stack exchange if there is an update.