2.3 User interface, provider vs. consumer

You need to keep two hats when you program using data abstraction. First, you should wear the hat labeled ``consumer''. When you wear this hat, you think of how someone may want to utilize the data without caring for the actual implementation (how it is done). The collection of all the things that a consumer may want to do becomes the ``user interface''. In the television analogy, you need to pretend to be a consumer with minimal knowledge of how television works, and just want to catch a ball game. The user interface is the remote control.

As the designer of a data type, you also need to wear the hat labeled ``provider''. When you wear this hat, you need to think about how to implement all the cool features in the user interface. In the analogy of televisions, this is the process of designing the circuits and components of a television.



Copyright © 2006-09-07 by Tak Auyeung