Background: I have a large (several hundred lines) class that manages a concept based on some primitive-type data structures
long[] slist; //list of unique patterns (related to polyominoes)
int[][][] sref;//patterns at each place [location][depth][<list of indices in slist>]
Question: The two methods that populate and update these data are going to be quite long, with handfuls of 5-20 line tasks, some shared, others unique. I probably want to make a helper method for each sub-task.
update(...){
//do A
//do B
//do C
//...
}
build(){
//do D
//do B
//do E
//...
}
The problem is if there are too many unrelated helper methods in one file, readability does not improve.
The answer to this question gets me most of the way there. I can declare the structures in the same package, in their own class, and access the primitive member field or call related methods. But I still want to know the accepted wisdom here because this organization did not come easily to mind.
Would you ever go so far as to put update()
and build()
functions in their own files? If so, where should their common tasks be declared?