Smalltalk and Object Orientation: an Introduction - Free
Smalltalk and Object Orientation: an Introduction - Free
Smalltalk and Object Orientation: an Introduction - Free
Create successful ePaper yourself
Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.
defining the behavior of different categories of vehicle. The second diagram presents th e sub type<br />
relationships between the categories while the third diagram illustrates a straight specialization set of<br />
relationships. Note that although the estate car is a specialization of a car with hatch, its implementation<br />
(the subclassing hierarchy) in dicates that it does not share <strong>an</strong>y of its implementation with the car with<br />
hatch class.<br />
Vehicle<br />
Vehicle<br />
Vehicle<br />
MotorVehicle<br />
MotorVehicle<br />
MotorVehicle<br />
Car<br />
Car<br />
Car with Hatch<br />
Sports Hatch<br />
Estate Car<br />
Car<br />
Car with Hatch<br />
Estate Car<br />
Subtyping<br />
Car with Hatch<br />
Sports Hatch<br />
Estate Car<br />
Subclassing (inherit<strong>an</strong>ce)<br />
Sports Hatch<br />
Specialization<br />
Figure 2.6: Distinguishing between the relationships<br />
It is worth noting that <strong>an</strong>other difference between type <strong><strong>an</strong>d</strong> subclassing is that type relationships are<br />
specifications, while classes (<strong><strong>an</strong>d</strong> subclasses) are implementations of behavior.<br />
2.4 Why bother?<br />
We have already stated that the tr<strong>an</strong>sition from a procedural view point to <strong>an</strong> object oriented view poi nt<br />
is not always <strong>an</strong> easy one. This begs the question “why bother?”. As you are reading this book you must<br />
at least be partly convinced that it is a good idea. Of course this could be because you have noticed the<br />
number of job advertisements offering employ ment for those with object oriented skills. However, that<br />
aside, why should you bother learning a new programming paradigm?<br />
Hopefully, some of the reasons why you should bother will become clear during your reading of this<br />
book. However, it is worth considering at least some of the issues at this point.<br />
2.4.1 Software industry blues<br />
There is still no silver bullet for the problems in the software industry. <strong>Object</strong> oriented technology does<br />
not take away the problems which exist in constructi ng complex software systems, it just makes some<br />
of the pitfalls harder to fall into <strong><strong>an</strong>d</strong> provides ways of simplifying traditionally difficult problems.<br />
However, difficulties in software development are almost inevitable, m<strong>an</strong>y of them arise due to the<br />
inescapable int<strong>an</strong>gibility of software <strong><strong>an</strong>d</strong> not necessarily all by accident or poor development methods.<br />
We should not however just throw up our h<strong><strong>an</strong>d</strong>s <strong><strong>an</strong>d</strong> say “well if that’s the case, it is not our fault”.<br />
M<strong>an</strong>y of the problems which have beset our industry relat e to some deficiency in how programmers<br />
build software today. For example, if a software development is running late then just adding more<br />
people to that late project is likely to make matters worse rather th<strong>an</strong> get the project back on time.<br />
Of course obje ct technology is not the first attempt at addressing these issues. However, past<br />
attempts have met with mixed success. This is for a number of reasons, only some of which we will<br />
consider below. However, as these issues are particularly pertinent to object technology, we will<br />
therefore consider each in turn.<br />
28