Design for the Real World

The independence of a module from the rest of the application is called loose coupling. The ability of the code within a module to be self-existent, that is to be complete and entire for its function, is called tight cohesion. Good modules are both loosely coupled and tightly cohesive. If a module has these two characteristics, then reusability becomes a possibility. If a module is reusable, that is truly wonderful.

If an application is designed well in a modular fashion, two things happen. First, it becomes easy to switch out one module for another. Second, adding a new module with new functionality becomes much easier and possibly very simple. No one knows if a module they create will be reused in the future in some ...

Get Oracle Database Ajax & PHP Web Application Development 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.