Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

Share this Page URL

Chapter 8. Debugging applications > Debugging bundles - Pg. 259

Debugging bundles 259 you examples of how to debug all these problems and suggest best practices based on our collective experience of working with real-world OSG i applications in the field. Let's kick off with something simple. Say you have an application composed of many working bundles and one misbehaving bundle: how do you find the bad bundle and debug it? 8.1 Debugging bundles Applications continue to grow over time--more features get built on top of existing functionality, and each code change can introduce errors, expose latent bugs, or break original assumptions. In a properly modularized OSG i application, this should only lead to a few misbehaving bundles rather than a completely broken application. If you can identify these bundles, you can decide whether to remove or replace them, potentially fixing the application without having to restart it. But first, you need to find out which bundles are broken! Take the paint example you've worked on in previous chapters. Imagine that you get a request to allow users to pick the colors of shapes. Your first step might be to add a setColor() method to the SimpleShape interface: /** * Change the color used to shade the shape. *