Are you an EPFL student looking for a semester project?
Work with us on data science and visualisation projects, and deploy your project as an app on top of Graph Search.
This lecture delves into the Observer design pattern, focusing on its application in graphical interfaces. Through the example of a simple spreadsheet, the instructor illustrates how cells can observe changes in other cells' values, ensuring automatic updates. The implementation involves defining Subject and Observer interfaces, where subjects maintain a list of observers and notify them of any changes. Concrete classes representing cells are made observable, with ValueCell storing an integer value and SumCell calculating the sum of two other cells. The lecture concludes by discussing the Observer pattern's benefits and limitations, emphasizing its significance in graphical user interfaces.