Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

proper Java package hierarchy?

Tags:

java

package

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 any affiliation with them otherwise.) I'd think that I should want to instead use my own reverse domain for the package specifier.

Thoughts?

like image 581
Sophie Alpert Avatar asked Apr 26 '26 08:04

Sophie Alpert


2 Answers

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.

like image 95
Jay Askren Avatar answered Apr 27 '26 22:04

Jay Askren


the idea is that the package names will be globally unique

like image 43
Matthew Avatar answered Apr 27 '26 20:04

Matthew