简体   繁体   中英

Package/directory conventions in Java

I want to use christophel.joel as my root package until I get a domain name. Which of the following is a better practice?

  • Different set of christophel and joel folders for each project

    Example: \\Project Name\\christophel\\joel\\subdirectory\\ClassName.java

-OR-

  • Only one set of christophel and joel folders

    Example: \\christophel\\joel\\projectname\\subdirectory\\ClassName.java

If you want to use package structure like one you specified then first option will be the preferred. But as per Java coding convention you should use reverse structure of your domain (if any) name for example:

com.example.functionalityCategory

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM