System Analysis and Design System Implementation - Mr. Ahmad Al-Ghoul learning Objectives explain a structure chart showing top-down design, modular design, cohesion, and coupling Avicenna System Analysis and Design System Implemantation 2 Structured Application Development Structure Charts Avicenna Structure charts show the program modules and the relationships among them Control module: In a structure chart, a control module is a higher-level module that directs lower-level modules, called subordinate modules. Subordinate modules: A lower-level module in a structure chart. System Analysis and Design System Implemantation 3 Structured Application Development Structure Charts Module A self-contained component of a system, defined by a function One single coordinating module at the root of structure chart Single point of entry and exit Communicate with each other by passing parameters Avicenna library module: In a structure chart, a library module is a module that is reusable and can be invoked from more than one point in the chart. System Analysis and Design System Implemantation 4 Structured Application Development Data and control passed between structure chart modules is either a: Data couple, A diagrammatic representation of the data exchanged between two modules in a structure chart passing only data, shown as an arrow with an empty circle. Control couple shown as an arrow with a filled-in circle. In a structure chart, a control couple shows a message, also called a flag, which one module sends to another. Avicenna A module uses a flag to signal a specific condition or action to another module System Analysis and Design System Implemantation 5 Structured Application Development Control modules make the decisions about which lower-level modules should be executed. Lower-level modules are functional, performing only one task. Systems analysts should keep the number of couples to a minimum. Avicenna The fewer data couples and control flags one has in the system, the easier it is to change the system. System Analysis and Design System Implemantation 6 Structured Application Development The update customer file module sends an account overdue flag back to the maintain customer data module An example of a structure chart control couple. Avicenna System Analysis and Design System Implemantation The look up customer name module exchanges data with the maintain customer data module An example of a structure chart data couple. 7 Structured Application Development Structure Charts – Notation Modules Library modules Module call Data Flag Avicenna System Analysis and Design System Implemantation 8 Structured Application Development Structure Charts Condition: A line with diamond on one end presents a condition A specified action or state in a structure chart. A condition line indicates that a control module determines which subordinate modules will be invoked, depending on a specific condition Sort inventory parts is a control module with a condition line that triggers one of the three subordinate modules An example of a structure chart condition and condition lines. Avicenna System Analysis and Design System Implemantation 9 Structured Application Development Structure Charts Loop: A curved arrow represents a loop In a structure chart, a loop indicates that one or more modules are repeated. The get student grades and calculate GPA modules are repeated for each student An example of a structure chart loop. Avicenna System Analysis and Design System Implemantation 10 Structured Application Development In order to choose among alternatives when dividing systems into modules, it useful to evaluate the connection between them. If there are few or no connections between modules, then it is easier to understand one module without reference to others. The notion of module independence can be described in terms of ‘coupling’ and ‘cohesiveness’. These concepts were introduced by Edward Yourdon and Larry Constantine who are concerned with ‘goodness’ of design. Avicenna System Analysis and Design System Implemantation 11 Structured Application Development Coupling: Coupling measures relationships and interdependence among modules. Coupling is the strength of relationships between modules (the degree to which modules are interconnected with or related to one another). The stronger the coupling between modules in a system, the more difficult it is to implement and maintain the system, because a modification to one module will then necessitate careful study, as well as possible changes and modifications, to one or more other modules. In practice, this means that each module should have simple, clean interface with other modules, and that the minimum number of data elements should be shared between modules. Avicenna System Analysis and Design System Implemantation 12 Structured Application Development Loosely coupled: Modules that are relatively independent. Loosely coupled modules are easier to maintain and modify, because the logic in one module does not affect other modules. Tightly coupled: If modules are tightly coupled, one module refers to internal logic contained in another module. Avicenna System Analysis and Design System Implemantation 13 Structured Application Development This figure shows two examples of coupling In the tightly coupled example, the subordinate module, Calculate Current Charges, depends on a status flag that is receives from control module, Update Customer Balance. The loosely coupled modules on the left are logically independent. Rather than passing flag down to the subordinate module, the control module allows the Apply Discount module to handle discount processing independently. Logic errors, if any, are confined to the Apply Discount module, where they can be detected and resolvedAn example of loosely coupled and more easily tightly coupled structure charts. Avicenna System Analysis and Design System Implemantation 14 Structured Application Development Cohesion: Cohesion measures a module's scope and processing characteristics. Avicenna Cohesion is the measure of the strength among the elements in the same module (the degree to which the components of a module are necessary and sufficient to carry out one, single, well defined function). In practice, this means that the systems designer must ensure that they does not split essential processes into fragmented modules and the systems designer must ensure that they does not gather together unrelated processes (represented as processes on the DFD) into meaningless modules. The best modules are those that are functionally cohesive. The worst modules are those that are coincidentally cohesive. High cohesiveness occurs when all of the module parts contribute directly to the purpose or function which the module is supposed to accomplish. If you need to make a module more cohesive, you can split it into separate units, each of which performs a single function System Analysis and Design System Implemantation 15 Structured Application Development In the figure below the task called Check Customer Status actually consists of two separate tasks: Check Customer Number and Check Customer Credit Limit. Notice that the figure with one module is less cohesive than the figure with the two modules, because it combines the two tasks into a single module, while the other figure treats them as separate modules, you achieve more cohesion and better program quality An example of structure chart cohesion. Avicenna System Analysis and Design System Implemantation 16 Structured Application Development advantages Structure Charts: Modularity improves system maintainability Provides a means for transition from analysis to design Provides a synchronous hierarchy of modules disadvantages Structure Charts: Avicenna Does not work well for asynchronous processes such as networks Could be too large to be effectively understood with large programs. System Analysis and Design System Implemantation 17 Sequence Summary A structure chart consists of symbols that represent program modules, data couples, control couples, conditions, and loops A rectangle represents a program module, which consists of program code that accomplishes a specific function An arrow with an empty circle represents a data couple, which shows data that one module passes to anther An arrow with a filled circle represents a control couple, which shows a message, also called a flag A line with a diamond on one end represents a condition, which indicates a control module that determines which subordinate module are invoked, depending on a specific condition A curved arrow represents a loop, which indicates that one or more modules are repeated Cohesion measures a module’s scope and processing characteristics A module that performs a single function or task has a high degree of cohesion, which is desirable Coupling measures relationships and interdependence among modules Modules that are relatively independent are loosely coupled, which is desirable Avicenna System Analysis and Design System Implemantation 18 Sequence Summary In this Sequence we have Avicenna Defined the terms structure chart, control module, Subordinate module, library module, Data couple, control couple, condition, and loop Described a structure charts – notation Explained a structured application development explained a structure charts, cohesion, and coupling Described a structure charts advantages and disadvantages System Analysis and Design System Implemantation 19 Reference [1] System Analysis and Design, Sixth Edition Authors: Gary B. Shelly, Thomas J. Cashman and Harry J. Rosenblatt Publisher: SHELLY CASHMAN SEWIES. Avicenna System Analysis and Design System Implemantation 20