Part 5. Advanced topics and best practices
You should now have a firm grasp of Struts 2 and its architecture. From actions to interceptors and ultimately the result, the pieces interact like parts in a well-oiled machine. In fact, you’ve learned enough now to run off and start building your website. But hold your horses! In part 5, we cover material that can help you work smarter.
Chapter 12 explains the plug-in architecture and how the framework can be extended by simply dropping a plug-in JAR on your classpath. You might never need to write one yourself, but once you discover the bounty of plug-ins already available, you may quickly incorporate their features into your site. Modern software adheres to the open-closed principle, which means it’s open for extension but closed to modification. Simply stated, we no longer check out code and monkey around with it to get extended behavior. The plug-in architecture in Struts 2 is similar to that found in Firefox and Eclipse.
In chapter 13, you’ll learn best practices from the trenches. Topics shared here are those that you can easily begin using right away to provide immediate benefit to you and your project. We discuss setting up your IDE, unit-testing code, validation, and maximizing reuse.