UCL / rsd-engineeringcourse

Course materials for Research Software Engineering course.
http://github-pages.ucl.ac.uk/rsd-engineeringcourse/
Other
108 stars 97 forks source link

Design Patterns page #108

Closed mattagape closed 5 years ago

mattagape commented 5 years ago
  1. The GoF book is mentioned but people may find it easier to read "Design Patterns for Dummies" (https://www.amazon.co.uk/Design-Patterns-Dummies-Steve-Holzner/dp/0471798541). I have and I think it's a good book.

  2. The %matplotlib inline should go at the start of "Strategy pattern example: sunspots". Remove from line above and also from line below.

  3. Typo: unweildy should be unwieldy

  4. In "Apply the strategy pattern", which is already quite confusing, why do we show the traceback?

ageorgou commented 5 years ago
  1. I have also found "Head First Design Patterns" (http://shop.oreilly.com/product/9780596007126.do) to be a useful book, but haven't gone through the whole thing enough to feel confident recommending it to a class.

  2. Class Complexity: We list one decision; could perhaps list more examples ("How much flexibility should I allow in this class's inner workings?", "Should I split this related functionality into multiple classes or keep it in one?")

  3. Reading a pattern: We could perhaps simplify this, and group together or omit some of these, or briefly explain them (without knowing what each item involves, the list can be a bit disorienting)

  4. Introducing Some Patterns: I would write "Model-View-Controller" (with hyphens)

  5. Strategy pattern:

    • Can the csv reading by simplified? We came across something similar in the first lectures, but I don't remember what the answer was.
    • In "Apply the strategy pattern", final code has an error. The problem is in FourierNearestFrequencyStrategy, where we write series.count/2 (in a couple of places). This should be series.count//2 for Python 3, to ensure the result is an int. This seems fixed in the other straegy examples.
  6. Model-View-Controller: We could write a few words about what each of the three components is meant to take care of (e.g. under Model: "This is where we describe our internal logic, rules, etc"; under View: "This is where we describe what the user sees of our Model")

dpshelio commented 5 years ago

@mattgillucl

  1. added
  2. solved
  3. fixed
  4. fixed

@ageorgou

  1. added
  2. done
  3. Explained them
  4. Fixed
  5. a) We used raw but it doesn't work with csv; b) fixed
  6. done