Chapter 5. Ratpack Modules
Ratpack’s framework features are separated into different modules that can be made available to an application by bringing a module of interest onto a project’s classpath. This allows the framework to be feature rich, while remaining lightweight and resource efficient. For instance, for applications that do not need support for authentication or sessions, those supported modules need not be included in the project.
It is important to note that modules differ slightly from the plugins you find in other popular web application frameworks. In those frameworks, there is often an internal plugin manager that framework code will reach out to in order to decorate an application with some functionality. Ratpack has no plugin infrastructure, but instead allows modules to affect an application’s functionality by providing the framework with classes that serve to decorate or extend core functionality.
The component model for modularity and extensibility has added benefits in that functionality is provided through the exact same mechanism through which an application’s components are provided. This gives more granular control to application developers in the case where they need to adapt a framework feature to their specific use case. Ratpack takes it a step further by giving control to the application in ascertaining what component is resolved and when. In most cases, you will not need to adjust a module’s behavior, but in a scenario where you want to override ...
Get Learning Ratpack now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.