开发者

proper Java package hierarchy?

开发者 https://www.devze.com 2022-12-16 02:30 出处:网络
I just started looking at the new FIRST Robotics Java SDK, which includes project generators to build sample robotics programs.

I just started looking at the new FIRST Robotics Java SDK, which includes project generators to build sample robotics programs.

Something I was curious about is the file it generates begins with:

package edu.wpi.first.wpilibj.templates;

Does this actually make sense? (The library I'm using is from first.wpi.edu, but my project doesn't really have an开发者_运维知识库y affiliation with them otherwise.) I'd think that I should want to instead use my own reverse domain for the package specifier.

Thoughts?


I would say your intuition is correct. I would personally refactor it to be your own package. Is this just a tutorial project it generated, or is it your project that you are going to be working on. If this is not a tutorial project, I would be surprised if there is no way to override the package name when it is created.


the idea is that the package names will be globally unique


I would think that it would generate something in a customer supplied package name? Ie: ask the user the package they would like to use.

Does it generate things in more then one package?


It probably does this so it can access "package local" classes.

0

精彩评论

暂无评论...
验证码 换一张
取 消