maveronyx/OnyxAdmin — comment on commit 2d09dd44f42ff7b741358bfb76c1fc9bfc0b4dca
File:  line 0
By tustin2121:

If you become a better programmer because of me, I will sleep easier at night knowing there is one more good programmer out there. :)

Anyhow, don't be afraid of a lot of classes. In Java, you HAVE to make a lot of classes - that's how callbacks are done in Java. If this were C or C++, the callbacks would be function pointers and you'd be using a ton of those. So many classes are kinda necessary in Java. Fortunately, Java has packages to help organize them (and my next commit, assuming all goes well, will show you how packages can be used).

Anyhow, using separate classes for each command makes it easier to see what command is using what code, and keeps things nice and orderly. Plus, it won't require a huge set of if statements or, as seen here, a large switch statement. Calling a single function will just work (with the classes set up properly). You'll see. :)

(Also, note, I'm not really adding any functionality at the moment, so if need be, this should be reversible and it should all work still)