1 / 4

Abstract Data Types (ADTs)

Abstract Data Types (ADTs). Chapter 15. Hiding Design Decisions. Why hide design decisions? The question perhaps should be: why expose them? By hiding the decisions on how data is manipulated and represented, we “reserve the right” to change the representation and means of manipulation!

winola
Download Presentation

Abstract Data Types (ADTs)

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. Abstract Data Types (ADTs) Chapter 15

  2. Hiding Design Decisions • Why hide design decisions? The question perhaps should be: why expose them? • By hiding the decisions on how data is manipulated and represented, we “reserve the right” to change the representation and means of manipulation! • This provides a degree of flexibility that insulates us from “tight binding” (close coupling) to the rest of the systems implementation.

  3. ADT Signatures and Axioms • The “signature” is the graphical representation of the methods of access, and the operations that can occur. (see diagram 15.1, page 302). • ADT signatures are combined with other ADT signatures to show the interaction of the types within the system. • “Axioms” are the algebraic assertions about the ADTs that are useful for the programmer to know.

  4. Encapsulation and C • C scoping rules and the preprocessor can be used to our advantage to encapsulate. • Manifest constants (in header files) can allow us to “conceal” (or pretend to) values that are actually used in the ADT implementation. • We can use the ‘extern’ directive to expose the actual manipulation routines. • We can use the ‘static’ declarations on functions to conceal internal details to routines outside of the compilation unit.

More Related