Published Sep 3, 2019

Episode 82: Organization of Large Code Bases with Juergen Hoeller

Juergen Hoeller, co-founder of the Spring Framework, delves into the strategic use of metrics, modular design, and customization to manage the evolution, organization, and extensibility of large codebases, ensuring adaptability and backward compatibility.
Episode Highlights
Software Engineering Radio - the podcast for professional software developers logo

Popular Clips

Episode Highlights

  • Codebase Organization

    , co-founder of the Spring Framework, shares insights on organizing large codebases for maintainability and extensibility. He emphasizes the importance of conceptual modules and boundaries, which help in structuring code effectively. explains that while tools like Maven assist in building deployment units, the real challenge lies in maintaining a loosely coupled source code structure.

    It's not just about using the right tool and having a tool to support you, but it's also about how you generally organize your code and to have those conceptual modules in place.

    ---

    This approach ensures that the codebase remains navigable and adaptable as it evolves 1 2.

       

    Circular References

    Circular references pose a significant challenge in large codebases, often leading to maintenance nightmares. uses the Java Development Kit (JDK) as an example, where packages like Java lang and Java util have become tightly interdependent over time. He highlights the importance of avoiding such entanglements in frameworks like Spring, which aim for modularity and reusability.

    The JDK is a good example for anybody interested in source code organization. Have a look at the JDK and learn some lessons.

    ---

    By designing independent subsystems, Spring allows for greater flexibility and easier maintenance 3 4.

       

    Package Structure

    The Spring Framework employs a strategic package structure to manage dependencies and maintain cohesiveness. explains that while Java packages are fundamental, they often require additional structuring to handle internal APIs and third-party dependencies. Spring uses top-level packages for cohesive subsystems and sub-packages for specialized implementations.

    We build top-level packages for each cohesive subsystem, more or less.

    ---

    This organization helps in navigating the codebase and supports compatibility with various library versions, ensuring that users can continue using older versions without forced upgrades 5 6.

       

    Refactoring Strategies

    Spring's approach to refactoring involves balancing backward compatibility with the need for innovation. discusses the use of creative refactoring strategies to introduce new functionalities while maintaining existing customization hooks. The framework employs extended interfaces, such as the bean post processor, to allow for flexible modifications.

    We try to preserve, let's say a 99% backwards compatibility even there, using deprecation and so forth.

    ---

    This strategy ensures that developers can rely on stable APIs while benefiting from new features 7 8.

Related Episodes