19 - 19. PROGRAM DESIGN Module Design Its a good idea to...

Info iconThis preview shows pages 1–5. Sign up to view the full content.

View Full Document Right Arrow Icon
19. PROGRAM DESIGN
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Module Design • It’s a good idea to think of each source file as a module, with an associated header that describes what the module provides to the rest of the program (the module’s interface). • Typical kinds of modules: A collection of functions A data structure A type that represents a data structure
Background image of page 2
Information Hiding • Information hiding means that one part of program hides details from other parts of the program. • When we design a module, we want the rest of the program to have access to information in the module’s header file, not information in the source file. • Advantages of information hiding: Easier to find bugs. More importantly, easier to make major changes to a data structure without affecting the rest of the program.
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Information Hiding • The static storage class is useful for enforcing information hiding in C. • static variables and functions are limited to use within a single file (module); they’re hidden from the rest of the program.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 07/08/2011 for the course CGS 3460 taught by Professor Staff during the Summer '08 term at University of Florida.

Page1 / 8

19 - 19. PROGRAM DESIGN Module Design Its a good idea to...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online