lucproglangcourse / lucproglangcourse.github.io

Lecture notes for COMP 371/471: Programming languages course at Loyola University Chicago with a focus on functional languages and projects mostly in Scala
MIT License
1 stars 1 forks source link

additional background for section 3.6 #7

Closed klaeufer closed 2 years ago

klaeufer commented 4 years ago

To wrap your head around section 3.6, you may want to start by recalling/reviewing the stopwatch project from 313. In that app, the model is rather complex and has three or four components that depend on each other. After creating the instances of those components, you had to connect them to each other using setters. Does that ring a bell? In section 3.6 and the pertinent examples, we are achieving basically the same goal by plugging two or more traits together declaratively. I hope this helps as background for making more sense of that section.