And that’s it for our introduction to using Object Oriented (OO) design techniques. We’ve looked at inheritance, multiple inheritance and polymorphism, and you can see how designing the class tree structure in this way forces the designer to fully understand the problem.
It also defines very clearly the code that needs to be produced. Even from this simple design, you can see that if you know how to write the functions, then you are already well on your way to creating the finished maze game. Perhaps even more usefully, if you don’t know how to write the functions, you know exactly what you need to research. It’s even possible that a number of the required functions already exist in publically available code libraries, so you might well benefit immediately from code reuse!
The design, you’ll notice, has not been language specific. When using UML the choice of implementation language need not be decided on until the final design is complete. You can also see how code reuse is encouraged, and how planning the solution carefully means that the code production is going to be far more manageable.
So, the bottom line is if you do the preparation work well, you’ll have a solid OO design that will make your project far more likely to succeed. You’ll understand the problem, and your design solution will be bound to actually solve it!