Java package naming. Underscores: A special case -
today naming package in project contain code related concept called "access structure".
now, naming package "com.myemployer.project.component.accessstructures" seems unappealing , difficult read because of triple "s". (the higher level packages not actually named "project" , "component").
i tempted use "...component.access_structures"
i couldn't find mentioned in java conventions on oracle's site . , brief web search brought nothing.
what official convention names this?
from oracle docs
package names written in lower case avoid conflict names of classes or interfaces.
companies use reversed internet domain name begin package names—for example, com.example.mypackage package named mypackage created programmer @ example.com.
name collisions occur within single company need handled convention within company, perhaps including region or project name after company name (for example, com.example.region.mypackage).
in cases, internet domain name may not valid package name. can occur if domain name contains hyphen or other special character, if package name begins digit or other character illegal use beginning of java name, or if package name contains reserved java keyword, such "int". in event, suggested convention add underscore
although text doesn't specify exact case, invalid package name should use underscore. 1 argue accessstructures
how define method in java , naming package confusing. overall, you.
if want keep convention, believe should name package:
com.myemployer.project.component.access_structures
also can synonyms , find alternatives give less confusion. found:
- accessframework
- accessfactory
- accessarch (accessarchitecture)
- accessconstructs
Comments
Post a Comment