Java User Defined Package Naming Convention (Spring, Android, ...)RyanGomdoriPooh 2021. 10. 30. 16:08
We usually make package name for Java program.
But, when we try to name package, we don't know how to name the package.
In this post, We look what package name is and how to make package name by examples.
let's look at some principles for package naming convention.
- What is package name?
- How to make package name
- Examples for package name
1. What is user-defined package name?
- Package name is a unique value of the applications.
- Our application has a unique package name. Because it is to distinguish other applications.
2. How to make user-defined package name
- Many applications use "company name" or "domain address" for package name because of it is unique.
- The "domain address" must use in reverse order.
- Recommend that it use lower case.
- Recommend that it don't use upper case.
- Divide source files into groups using dot('.').
- File packages are made by package name which is made.
3. Examples for user-defined package name
[Domain in reverse order].[Program name]
[Domain in reverse order].[Platform].[Program name]
Developers feel difficult for package naming convention. Because They don't know how to make name for package.
But, It is easy to make User-defined package name. Keep in mind to make unique name for java source.
So, We usually are using for domain name or application service name.
Just make user-defined package name according to the principles written in this post.