I dont have enough of a grip on OO design to determine whether I am designing application well or not.
Here is a simple Idea:
I want to code a application for travelling on Metro.
I started of definining the following:
Trainline Interface which defines some methods. Then I create a concrete class called Lines. Lines class does nothing much at all. It has methods like getNumberOfStations() but it has no idea about any number of stations so just returns null.
Then I have a CentralLine class which does the real work and this extends Lines and this provides the real implementation.
Questions:
- Do I need "Lines" concrete class ? Should I just not have CentralLine and CircleLine implement TrainLines (these are both train lines on the London underground)?
- Or should I remove TrainLines interface and just have the Lines concrete class ?
- Or should TrainLines be an abstract class ?
- Does the interface or the Lines superclass provide any value at all apart from a pretty class map diagram ... see above :)
- What things can OO do for me that would be cool ? What things should I be looking to do with OO design ?
Thanks !!!!