1.1.05. Abstraction

  • Previous lab exercises
    • Problem: reading data from a file
  • Abstraction theme
  • Basis of good OOP and further good P
    • from encapsulation to software component analysis
  • Layering, splitting data from design
    • Solution: grammar (language guide) and data

In some of your previous lab assignments, or practical experience, you may have been faced with the problem of caching information persistently in a file, later to be reloaded.

When writing the data into the file, we are storing more than just that information. We are storing implicitly a design/grammar for that data. That implicit design is evident when accessing the file with a naive interface. If you try to read the data out in a different order, it fails.

A better solution is to split the way the information is stored from the actually information stored.