As requirements change and a project matures, it is helpful if you can change parts of the application without having these changes cascade throughout the system. Modularizing an application allows you to build application components separately (and loosely coupled) and to change whole parts of your application without affecting the rest of the code.
The Prism package is a mix of framework and guidance for building applications. The framework, called the Component Application Library (CAL), enables the following:
- Application modularity: Build applications from partitioned components.
- UI composition: Allows loosely coupled components to form user interfaces without discrete knowledge of the rest of the application.
- Service location: Separate horizontal services (for example, logging and authentication) from vertical services (business logic) to promote clean layering of an application.
My example in this article uses as much of the CAL as possible. It is a shell application that uses the CAL to load several modules at run time, place views in regions (as shown in Figure 2), and support services.