




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!





















An Example of Abstraction
An Example of Abstraction
Triangle :color :point[3] setColor() draw()
Square :point[4] draw() Triangle :point[3] draw() Shape :color setColor() draw()
point in drawing them.
and PictureViewer depend on each other and so cannot be used separately.
list and list_iterator to be tightly coupled.
PictureObserver only contains the interface of the update() function - that’s useful
so it would inherit from PictureObserver.
observers.
amount of memory used by the picture and how many shapes were in it, we would want it to update as the window was changed, and, to do so, we simply derive a StatsViewer class from PictureObserver.