Chapter 4 of Victor’s book talks about XAML, C# and scratches at the surfave of both of these, including general information to make sure that the reader is able to follow further in the book regarding OOP(Object Oriented Programming) and in the subject regarding inheritance, he’s talking about superclasses and how the parent and children classes inherit the superclass in which they reside. He goes further into the analogies of how these work, and asks one to contemplate the pain of an inverse situation. He uses the example of fruit.
A superclass of “Fruit” as he describes, being that fruit is an edible container with the seeds of a plant inside. Oranges, Apples, etc. being children of the “Fruit” parent. In the case of inheritance, if Oranges and Apples are under the superclass of “Fruit” then both Apples and Oranges “know” that they are edible containers with seeds of their own plant. There is no need to “program” that individually when they are set as child-classes. If they were not set up as child classes, then one would have to individually tell each one, programatically, the properties of a fruit.
The inverse of this situation is one which I have encountered far too often – with much frustration, at that.
Many applications used – and still in very heavy use today, were often built reactionarily (… is that even a word?). What I mean by this is – there was a demand, and so came the birthing of some application or another. Every addition to this application was created as a reaction to a need.
Now, that doesn’t really sound bad on the surface. However, the reality of this is … not always good.
My day-after-new years-eve mind is having a difficult time coming up with a good example which would be easy to use, but the only things that I’m coming up with are so convoluted that most would get lost without diagrams.
Cleaning something of that nature up is much like many things – it might often just be easier to not even try to fix it and instead to start from scratch. This type of thing… I put up there with having a complex multi-page web-based application which has its styling willy nilly across the span of 200 aspx pages, 18 stylesheets and let’s not even talk about the markup styling done directly in the structure.
Leave a Reply