I'm pretty new to java and was wondering what the best contruction would be to accomplish the following:
I have got a class witch contains over 100 methods. They can be easily categorized so i'd like to seperate and spread them out over about 15 different java files. I'd also like to put those 15 files in a directory. (This all to keep the code readable). Now i'd like to be able to refer to the methods in those files as if they were in that main file that used to have all 100 methodes. Is this possible? and if not. What would be the best way to set up this construction?
thank you all in advance!
BTW. To clarify:
It doesn't only concern methodes but also variables.
I'd like to be able not only to REFER to but also able to HANDLE those methdoes and variables as if they were in that main file.
Don't know of any one size fits all solution here. 100 methods is certainly way too many for any one class to hold and so you are right to desire to refactor this. Are any of these methods very similar? I can't help wondering if the total number of methods could be reduced by some simplifications.
well.. the class is actually a collection of different data-storage parts. Each part holds the data of a certain event differently. For example if you have a row of numbers. One part holds the sum of those numbers. While another part holds the Spreading. And another part holds the ammount of numbers > 5. It's something like that, Only with more complicated parts who hold more info.
Each part uses 10 methods or so to hold and hand out the information in it.
Now a number of other classes have the reference to the big-database-with-over-100-methods and can therefore easily gather the information in it using only the reference: Database.Method();
I would like to make a different file for each datapart to make the code more readable without having to change the references.