1
h08
CS48 W20
Name:
(as it would appear on official course roster)
Umail address: @umail.ucsb.edu section
4pm, 5pm, 6pm
Optional: name you wish to be called
if different from name above.
Optional: name of "homework buddy"
(leaving this blank signifies "I worked alone"

h08: Software Patterns

ready? assigned due points
true Wed 02/19 02:00PM Mon 02/24 02:00PM

You may collaborate on this homework with AT MOST one person, an optional "homework buddy".

MAY ONLY BE TURNED IN IN THE LECTURE/LAB LISTED ABOVE AS THE DUE DATE,
OR IF APPLICABLE, SUBMITTED ON GRADESCOPE. There is NO MAKEUP for missed assignments;
in place of that, we drop the three lowest scores (if you have zeros, those are the three lowest scores.)


https://ucsb-cs48.github.io/w20/hwk/h08/

For this homework, please review these articles, in addition to the class slides from Lecture 8:

  1. (15 pts) Please fill in the information at the top of this homework sheet, including your name and umail address. Put the time your discussion section starts (4pm, 5pm, 6pm) in the space indicated (the one you are registered for—even if you usually attend a different one.) If the other two items apply, please fill them in as well. Please do this every single time you submit homework for this class.
  2. Software design patterns are formalized best practices that a programmer can refer to in order to solve common problems when designing an application or system.

    1. (15 pts) Going back to the origins of software design patterns, which four people were in the “Gang of Four”? What made them well-known?

    2. (15 pts) Name three overall classes of software design patterns. Explain, in your own words, what problems they each focus on, and why those problems exist.

  3. (25 pts) Pick three Design Patterns of your choice (from any category, but use examples from at least two different categories), and describe a situation from your own coding experience where you have either knowingly or unknowingly used this pattern, or where you could have benefitted from this pattern. Note that the MV\* patterns discussed in class are not listed in any of the categories mentioned in the links from the beginning, because they are higher-level architectural patterns rather than merely design patterns. You can pick any of those to answer this question, though, and consider architectural patterns as its own category.

























  4. (15 pts) Describe in your own words the difference between Patterns and AntiPatterns. Give examples of a scenario each (not a concrete coding problem, but a more general software production situation), in which you would benefit from either the knowledge of Software Design Patterns, or AntiPatterns.















  5. (15 pts) Pick one example from this list of Software Development AntiPatterns: <https://sourcemaking.com/antipatterns/software-development-antipatterns>, and describe a concrete problem from your own coding experience where awareness of this AntiPattern and its 'Refactored Solution' either did help or could have helped your software design.