1 / 10

Views of Data

Views of Data. Data – nouns of programming world the objects that are manipulated information that is processed Humans like to group information Classes, arrays Lists, stacks, etc. Data Abstraction View the data the way we want to (not the way computer does). Data Abstraction.

billy
Télécharger la présentation

Views of Data

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. Views of Data • Data – nouns of programming world • the objects that are manipulated • information that is processed • Humans like to group information • Classes, arrays • Lists, stacks, etc. • Data Abstraction • View the data the way we want to (not the way computer does)

  2. Data Abstraction • Abstract – can be scary, but you’ve already been doing that • Example: Integer • you view in a higher level than a computer (which uses bits, two’s complement notation) • All you need to know is what is an integer and what operations are allowed on them • The int type is encapsulated (surrounded by a nice neat package to manipulate it)

  3. Data encapsulation • Means the physical representation of data is surrounded, the user doesn’t see the implementation, but deals with data only in terms of its logical picture (or abstraction) • Separations of the representation of data from the applications that use the data at a logical level; a programming language feature that enforces information hiding

  4. Abstract Data Type (ADT) • A data type whose properties (domain and operations) are specified independently of any particular implementation.

  5. Data Structures • A collection of data elements whose organization is characterized by accessing operations that are used to store and retrieve the individual data elements • The concrete implementation of the composite data members in an abstract data type

  6. Features of ADTs • Data structures can be decomposed into their component elements • Component elements can be “arranged” in a way that affects their access • Both arrangement and way accessed are encapsulated. • Example: library

  7. Views • Logical (abstract) – What is ADT and what are its operations • (Application) – Use them • Physical (concrete) or implementation – How they are represented and how they work. ALSO THE ORDER WE’’LL STUDY THE ADTs

  8. Information Hiding in ADTs Separating class declaration/definition in .h and .cpp files aids information hiding (as well as using private) • Clients – access to info needed to use class and nothing more • Implementer – access to info needed to implement the module and nothing more

  9. Advantages to Information Hiding • Client • Easier to understand • Protected against inadvertently using implementation detail that may change • Implementer • Can freely modify representation of type or implementation of operation (client’s code will still work) • Implementation protected from erroneous use by client

  10. Categories of ADT operations • Constructors – bring into existence • Transformers (mutators) – change the state • Observers – predicates, accessor or selector functions, summary functions • Iterators – process all the components

More Related