As I mentioned earlier I am teaching a programming course at Centennial College.
I decided to use a non standard introduction by starting with doing back of the envelope calculations. In particular using what I refer to as Penzias numbers, to the best of my recollection I found them in a biographical sketch of Penzias. They are somewhat non standard since Google doesn't find any references.
This is a number system using just the digits 0, 1, and 3, and only defining multiply, where 3x3=10. Mathematicians will note that 3 equals root 10, and that this is a minor refinement of order of magnitude calculations.
This worked well, the examples (how much water flows through the Mississippi at the widest point) generated big numbers, which lead into scientific notation and multiplication of exponents, which lead into the binary number system.
Also the examples demonstrated the technique of solving a question by breaking it down into smaller parts, which will be a constant theme in the course.
Thursday, February 4, 2010
Wednesday, February 3, 2010
Fundamental Class Design Principles
The obvious complexity metric of a class library from the point of view outside the class is the number of interconnections between classes, in particular, getter and setter connections.
There are some exceptions to this metric. In a Model View Controller design the controller will need set access to the model values and the view will need get access. In a language like C++ that has the concept of friend classes this tight relationship can be explicitly specified. In other languages the connections need to be observed.
Direct access from further away than functionally coupled classes is an indication of either a design issue or a violation of the existing design.
There are some exceptions to this metric. In a Model View Controller design the controller will need set access to the model values and the view will need get access. In a language like C++ that has the concept of friend classes this tight relationship can be explicitly specified. In other languages the connections need to be observed.
Direct access from further away than functionally coupled classes is an indication of either a design issue or a violation of the existing design.
Tuesday, February 2, 2010
Back to Blogging
The blog has been on a hiatus. Time to get back to it.
I am now teaching web programming part time at Centennial. I have some comments to make about that (and I expect more in the future).
When I gave the talk at XP Toronto about the subject of this blog, I made an error. I said that it's about function call tree design only. I have since decided that is not true. Given a system implemented in an object oriented language (almost all now), the design must include the class partitioning as well.
I am now teaching web programming part time at Centennial. I have some comments to make about that (and I expect more in the future).
When I gave the talk at XP Toronto about the subject of this blog, I made an error. I said that it's about function call tree design only. I have since decided that is not true. Given a system implemented in an object oriented language (almost all now), the design must include the class partitioning as well.
Subscribe to:
Posts (Atom)