in reply to Design elegance : How to best design this simple program ?

This is one of those "impossible" questions. Without the whole code, or at least precise specs and information about what else is involved, no one can give serious recommendations about the design. The outline in the paragraph starting with "With this program, i want to …" sounds like this is done with a single script with a bunch of subroutines, and a class would already be over-engineered.

I say: spend less time thinking about the code structure (classes/roles) itself, and more time documenting the edges between your units of code, i.e. subroutines and their parameters and output, pre- and post-conditions. These parts will be immensely useful for writing tests, and live on even after refactoring, upgrading and other maintenance.

  • Comment on Re: Design elegance : How to best design this simple program ?