How should I name packages if I don#39;t have a domain associated with me?(如果我没有与我关联的域,我应该如何命名包?)
问题描述
所以大多数 Java 资源在谈到包时都会提到 com.yourcompany.project 设置.但是,我不在公司工作,也没有网站.是否有任何通用的命名约定?一个电子邮件地址,也许?
So most Java resources when speaking of packages mention a com.yourcompany.project setup. However, I do not work for a company, and don't have a website. Are there any naming conventions that are common? An email address, perhaps?
推荐答案
使用像bernard"这样的顶级域名或其他独特的域名.重要的部分是域是唯一的,这样可以避免冲突,而不是从真正的 Internet 顶级域开始,如 org 或 com.例如
Use a top-level domain like 'bernard' or something else unique. The important part is that the domain is unique so that you avoid clashes, and not that it starts with a real Internet top-level domain like org or com. E.g.
import java.util.*;
import bernard.myProject.*;
import org.apache.commons.lang.*;
这篇关于如果我没有与我关联的域,我应该如何命名包?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:如果我没有与我关联的域,我应该如何命名包?
基础教程推荐
- 使用堆栈算法进行括号/括号匹配 2022-01-01
- 修改 void 函数的输入参数,然后读取 2022-01-01
- 问题http://apache.org/xml/features/xinclude测试日志4j 2 2022-01-01
- 如何对 Java Hashmap 中的值求和 2022-01-01
- 存储 20 位数字的数据类型 2022-01-01
- Struts2 URL 无法访问 2022-01-01
- 无法复制:“比较方法违反了它的一般约定!" 2022-01-01
- Spring AOP错误无法懒惰地为此建议构建thisJoinPoin 2022-09-13
- RabbitMQ:消息保持“未确认"; 2022-01-01
- REST Web 服务返回 415 - 不支持的媒体类型 2022-01-01
