CSC207H5 Lecture Notes - Lecture 7: Common Interface, Git, Strategy Pattern
Document Summary
Working with an object with recursive structure. Ie. a component of class a is . In a graphics sense, a graphic can be composed of smaller graphics. Ie. whole picture car, tree rectangle, circle, circle, triangle, rectangle. Simple graphic components ie. rectangle, circle, triangle. Graphics that can be drawn as it is in its most basic form. In an arithmetic expression case, an arithmetic expression is composed of a smaller arithmetic expressions (1+2)*(3-4) (1+2), (3-4) 1, 2 . Composed of other values to create the sum/equation ie. (1+2), (3-4) ie. 1, 2, 3, 4. There are two types of nodes in the hierarchy. They are different in nature (attributes, method functionality) The composite component typically has an addelement() You want to be able to . Place each algorithm on a separate file. The class using the strategies has the strategy . Clients use the setter method to change strategies dynamically.