Modularity Java: top level vs. nested classes

Posted by an00b on Stack Overflow See other posts from Stack Overflow or by an00b
Published on 2011-03-18T16:08:37Z Indexed on 2011/03/18 16:10 UTC
Read the original article Hit count: 272

Filed under:
|
|
|

The Java tutorials that I read, like to use nested classes to demonstrate a concept, a feature or use.

This led me to initially implement a sample project I created just like that: Lots of nested classes in the main activity class.

It works, but now I got a monstrous monolithic .java file. I find it somewhat inconvenient and I now intend to break to multiple .java files/classes.

It occurred to me, however, that sometimes there may be reasons not to take classes out of their enclosing class.

If so, what are good reasons to keep a module large, considering modularity and ease of maintenance?

© Stack Overflow or respective owner

Related posts about java

Related posts about nested