Topic: Lab assessment. Design principles and patterns
NB you MUST do the lab assessment.
Lectures
Design:
- slides,
- video part 1 youtube, video part 2 youtube, video part 1 mediahopper, video part 2 mediahopper
In the Q&A/discussion session discussed matters arising from the lab assessment but there weren't many. I did promise to write some notes on part C but actually I will mostly do that once I've marked it so I can comment on common issues. For now here is a link to the Bran Selic paper I mentioned and to my own paper. Mostly we discussed design - what good and (mostly) bad examples had you come across and what was good and bad about them? We touched on the crucial issue of structure, with good naming, for ensuring maintainability of systems; limiting coupling (dependencies between parts of a system, where we mean B depends on A if when A changes, B might have to change) and maximising cohesion/coherence (as discussed on Piazza, cohesion is the usual term but I often slip into saying coherence which is in some ways more descriptive - we mean that things that logically go together stay together, which helps maximise the chance that all the changes you have to make to implement a change to a software system are "close" in the code). We discussed composition vs inheritance as ways to relate, for example, an AddressBook class and a collection classed used to implement it and I argued that composition is better even though it may require a few lines more code up front, because it gives you more control over the interface to the AddressBook. We started to talk about issues in the development process that have an effect on how good the design of a system is and stays. There is always a question about how much "big design up front" (BDUF) is beneficial and how much can be imposed later/on an ongoing basis. We'll probably talk more about this next week: for now have a look at this diagram of Extreme Programming practices and have a think about the relationships between them.
Videos
none apart from the lectures this week
Readings
- The Four Elements of Simple Design - browse the comments too! Quick revision questions
- Then read this follow-up: Putting an Age-old Battle to Rest. Quick revision questions
- Robert Martin's article on The Dependency Inversion Principle, found near the bottom here (NB do not confuse this with the Dependency Injection Inversion article, although that's also interesting.) Quick revision questions
- Derick Bailey's article on SOLID design (Remark: in a previous year it was pointed out that this reading's tone might be disturbing in places, with phraseology like "looks like his hair is on fire". I have not yet succeeded in finding a good drop-in replacement for the reading - suggestions are welcome - but in the meantime, let me just say that you should and could aspire to finding a work place where your manager would have a management style more conducive to everyone's productivity and low-enough stress!) Quick revision questions