Where Are We Now? - Quarter Semester
Thomas J. Kennedy
1 S.O.L.I.D
During the first week of class under The Beginning in the orientation module we briefly discussed S.O.L.I.D.
My colleagues and I disagree on when this should be introduced. I believe S.O.L.I.D should be discussed now… at the very beginning of the semester. To do so, we will have to split the word:
S.O.L.I.D = (S.O.) + (L.I.D.)
I will forgo my hilarious wordplay.. this time.
Example 1: The Beginning... S.O.Why are we starting with S.O.? First… we have all the tools we need to understand it:
- S - Single Responsibility Principle
- O - Open/Closed Principle
Second… these emerge naturally out of how we write code. We want to write reusable functions and classes. We want to be able to extend those classes without modifying the underlying code. Think about:
std::vector
std::list
std::unordered_map
std::iterator
That leaves three (3) letters for us to discuss:
- L - Liskov Substitution
- I - Interface Segregation
- D - Dependency Inversion
Combining everything, we are left with
-
S - Single Responsibility Principle
Every class, module, or interface has one responsibility (i.e., purpose).
-
O - Open/Closed Principle
It should be possible to extend a class, module, or function without modifying the original code.
-
L - Liskov Substitution - I - Interface Segregation
Fight the urge to throw in the kitchen sink. Focus on creating problem specific interfaces, not monolithic kitchen-sink-interfaces. This requires us to codify how to decompose a large problem (high-level design).
-
D - Dependency Inversion
Modules should not directly handle low-level calls and operations. Consider the C
FILE*
vs the C++ofstream
andifstream
.
Think back to Review 03 Examples 6 through 9…
2 Tools of the Trade
At the start of the semester… I introduced the names of various tools. In my examples (Reviews 01 to 03) I demonstrated a few of these tools. You were required (and in some cases all-but-required) to use a few of these tools on your own.
Let us take stock of our discussions and exercises thus far.
Category | Tool | Assignments | Lecture / Recordings |
---|---|---|---|
General | Linux | ✔ | ✔ |
General | SSH | ✔ | ✔ |
Build System | Makefiles | ✔ | ✔ |
Compilation | g++ | ✔ | ✔ |
Methodology | Unit Testing / TDD | ✔ | ✔ |
Editor | Vim | Hopefully | ✔ |
Version Control | Git | Hopefully | ✔ |
Documentation | Doxygen | Read Only | ✔ |
Documentation | Rustdoc | Not Yet | ✔ (Review 03) |
Documentation | Pydoc | Not Yet | Not Yet |
Configuration & Testing | Tox | Not Yet | ✔ (Review 03) |
Build & Configuration | Gradle | Not Yet | Not Yet |
Code Style Analysis | CPPLint | Not Yet | ✔ |
Code Style Analysis | Checkstyle | Not Yet | Not Yet |
Code Style Analysis | Pycodestyle / Pylint | Not Yet | Not Yet |
Design (UML Class Diagrams) | PlantUML | Maybe | ✔ |
Design (UML Sequence Diagrams) | SDEdit | Not Yet | Not Yet |