1 / 32

Modularity Menu

Modularity Menu Learning Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page 2 Overview of Modularity What is a module? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page 3

Download Presentation

Modularity Menu

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Modularity Menu Learning Objectives . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page 2 Overview of Modularity What is a module? . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . page 3 Reuse and Recycle with Modules . . . . . . . . . . . . . . . . . . . . . . page 5 Reasons for Modularity Reduces the Cost of Coding . . . . . . . . . . . . . . . . . . . . . . . . . .page 7 Simplifies Coding and Debugging . . . . . . . . . . . . . . . . . . . . . . . page 9 Helps Avoid Spaghetti Code . . . . . . . . . . . . . . . . . . . . . . . . . . .page 11 Supports the Entire Program Development Cycle . . . . . . . . . . .page 13 Reduces the Occurrence of "Side Effects". . . . . . . . . . . . . .page 15

  2. Modularity Learning Objective Upon completion of this lesson, the student shall be able to: 1. Define a module 2. List the benefits of modularity 3. Discuss the two types of costs associated with application development 4. Explain why spaghetti code is bad 5. Describe how modularity simplifies debugging 6. Explain why side effects are undesirable

  3. Modularity Overview What is a module? A module is a block of code that performs a single, well-defined function. The use of modules helps break large programs down into sets of small, manageable units.

  4. Modularity Reuse & Recycle Overview Code reuse is the practice of reusing a program or a part of a program in another application, thus saving time, energy and money. There are several reasons why modularity and reuse is needed.

  5. Modularity Reasons Reason 1: Modularity Reduces The Cost of Coding Two major types of costs associated with application development • Development costs – including design, coding and testing. • Maintenance costs – the cost of upgrading and repairing the software Code reuse can reduce both these costs

  6. Modularity Overview Reason 2: Modularity Simplifies Coding and Debugging It is easier to debug programs when the problem is broken up into smaller pieces. Each piece can be coded and tested individually.

  7. Modularity Overview Reason 3: Modularity Helps Avoid Spaghetti Code Single Entry Single coding techniques can be used with modules. GOTO statements, uncontrolled entries/exits and jumps in the code cause confusion and make the code harder to debug and modify.

  8. Modularity Overview Reason 4: Modularity Supports the Entire Program Life Cycle During the life of a program many people are involved with code development and maintenance. Modularity makes it easier to understand the changes made by others.

  9. Modularity Overview Reason 5: Modularity Reduces The Occurrence of “Side Effects” Changes made in one module are less likely to cause problem in the rest of the code. The risk of unintended consequences (side effects) is reduced with the use of modules. When in doubt see Murphy’s Law.

  10. Modularity Group – Pair Practice Scenario: You walk out of a great lecture to your car and discover a parking ticket that you obviously did not deserve. You walk over to the very tough police officer and ask them for a reprieve. The officer asks you to wait while he/she looks at your GPA on the system. Discuss the access controls that might be in place in the SIS that would prevent the officer from looking up your academic transcript. • Break up into groups of 3 or 4. • Consider the following: • Each college has a Student Information System (SIS) which consists of several independent components. Each component is used at a different stage of the admission, registration and graduation process. • The SIS maintains data for your entire time at the school. • When you registered for this class, you used an online system to process your registration. • Identify the components that a typical SIS might contain. • What components of the SIS are involved in the registration process? • Discuss other interactions among the different components of the SIS

  11. Modularity Quick Quiz

  12. TRY AGAIN!

  13. CORRECT!

  14. Modularity Quick Quiz

  15. TRY AGAIN!

  16. CORRECT!

  17. Modularity Quick Quiz

  18. TRY AGAIN!

  19. CORRECT!

  20. Modularity Quick Quiz

  21. TRY AGAIN!

  22. CORRECT!

  23. Modularity Quick Quiz

  24. TRY AGAIN!

  25. CORRECT!

  26. Modularity Quick Quiz

  27. TRY AGAIN!

  28. CORRECT!

  29. Modularity Quick Quiz

  30. TRY AGAIN!

  31. CORRECT!

  32. Modularity Congratulations! You have completed the modularity lesson

More Related