Lecture overview -- Keyboard shortcut: 'u'  Previous page: Visible and Hidden aspects -- Keyboard shortcut: 'p'  Next page: Representation Independence -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Help page about these notes  Alphabetic index  Course home  Page 9 : 29
Object-oriented Programming in C#
Classes and Objects
Program modification - the Fire Analogy

A fire correspond to a modification of a class. We are interested in limiting the consequences of the fire. In the world of OOP, encapsulation and visibility control have the same effect as firewalls in a large building.

A minor modification of a program may spread as a fire throughout the program.

Such a fire may ruin most of the program in the sense that major parts of the program may need to be reprogrammed.

A house - with firewalls - on fire. The fire is not likely to spread to other apartments because of the solid firewalls.

The use of firewalls prevents the spread of a fire.

Similarly, encapsulation and visibility control prevent program modifications from having global consequences.

Read more about the firewall analogy in the text book version of this material.