Complexity Simplified by Modularity

When designing a system, certain concepts will naturally sit together. By placing these into shared modules, a certain amount of separation can be achieved independently of the layering discussed so far.

Object-oriented (OO) modeling promotes modularity because objects encapsulate their data, or state, and offer functionality through their interfaces. If designed correctly, the dependencies between different objects can be minimized. This reduction in dependency means that the objects are loosely coupled. Loosely coupled systems tend to be easier to maintain and evolve.

Although they are not the whole solution, you have some useful tools for modularizing your applications in Java:

  • A Java class improves modularity by housing all state and behavior belonging to an entity into one part of the design.

  • A Java package uses modularity to house related classes and interfaces that perform a specific set of functions.

Additionally, you need a way of going beyond simple objects to provide more coarse-grained packages of functionality that can be glued together to create custom applications. To be correctly glued, these packages must conform to certain rules that are defined by a framework. This leads us to components.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.133.158.36