Organizing object-oriented code with the new modularity in Java 9
When we have just a few interfaces and classes, hundreds of lines of object-oriented code are easy to organize and maintain. However, as the number of types and lines of code start to increase, it is necessary to follow some rules to organize the code and make it easy to maintain.
A very well-written object-oriented code can generate a maintenance headache if it isn't organized in an effective way. We don't have to forget that a well-written object-oriented code promotes code reuse.
In our example, we will have just a few interfaces, abstract classes, and concrete classes. However, we must imagine that we will have a huge number of additional types to support the additional requirements. Hence, we will end up with dozens of classes related to the mathematical operations required to render the elements that compose a scene, additional types of lights, new types of cameras, classes related to these new lights and cameras...