Objectives: Introduction Over View of System Analysis and Design



Download 0.94 Mb.
View original pdf
Page100/140
Date13.11.2023
Size0.94 Mb.
#62581
1   ...   96   97   98   99   100   101   102   103   ...   140
ms-04
8.4.2
Coupling
Coupling refers to the strength of the relationship between modules in a system. In general, good designers seek to develop the structure of a system so that one module has little dependence on any other module. Loose coupling minimizes the interdependence between modules. We can achieve this in the following ways. Control the number of parameters passed between modules Avoid passing unnecessary data to called modules Pass data (whether upward or downward) only when needed Maintain superior/subordinate relationship between calling and called modules. Pass data, not control information Consider the manner in which data are passed in an accounting system. In editing a vendor record (for the accounts payable portion, two alternative designs for editing a vendor record (for the accounts payable portion) are available. In the first, typified by tight coupling, which is undesirable, the calling module passes the vendor name, vendor identification number, address, tax status and date. The called module returns the customer record, along with an end – of – file flag.

Figure: 8.1 Coupling & Cohesion in software design
Couplin
Coupling
Couplin
Coupling: Strength of relations Between Modules Strength Cohesion Strength of relation Within modules



Figure 8.2 Coupling and strength of relations between modules
Compare this with the preferred loosely coupled version in which only the vendor ID is passed to retrieve the same record of information. Not only does this design move less data (only non-superfluous data, but also there is far less dependence between modules. Only the vendor identification is needed to distinguish one vendor’s record from another. Since it is likely to be the record key, it is also unlikely to change. Other items in the record may change. Hence, the loosely coupled alternative is better suited to achieving the stated design and maintenance objectives. Edit vendor record Edit vendor record Retrieve vendor record Retrieve vendor record Vendor name vendor ID vendor address Tax status date Vendor record
EOF Vendor record
EOF Vendor ID

Download 0.94 Mb.

Share with your friends:
1   ...   96   97   98   99   100   101   102   103   ...   140




The database is protected by copyright ©ininet.org 2024
send message

    Main page