Modularity and Code Organization

   

The maintainability of a program is largely determined by how well the code is organized. Typical programs are large enough that no single programmer can focus on the details of an entire program at once. Instead, it is necessary to concentrate on a particular functional area while ignoring the implementation details of the remainder of the system. If a program is written using a few long and highly coupled functions, this task is nearly impossible for anyone other than the original programmer. On the other hand, when OOP is applied correctly, a modular design with minimal coupling is achievable. In general, this modularity is the result of two key factors:

  • When used correctly, OOP forces you to break your code down into many manageable pieces. Even in the simple examples so far, you have seen small code modules result from the definition of the object types needed to solve a particular problem.

  • By using OOP, each piece is organized naturally, without you having to actually think about the organization. In the car example, the organization of the code wasn't consciously considered ; it simply resulted from the thought process used to represent the entities of the problem domain.

   


Special Edition Using Java 2 Standard Edition
Special Edition Using Java 2, Standard Edition (Special Edition Using...)
ISBN: 0789724685
EAN: 2147483647
Year: 1999
Pages: 353

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net