Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • I do... (Score:1, Insightful)

    by pdcawley (485) on 2002.03.08 3:38 (#5627) Homepage Journal
    Who the hell cares what your object inherits from so long as it provides an appropriate interface in whatever context. Formalizing the interface concept is nice if you're a compiler, but can be a pain in the arse if you're a programmer. And if you get the interface wrong the program will die early with a sensible error message, so everyone's happy.

    Taking this approach helps a great deal if you start looking at techniques like mock objects for testing, or facade type objects that delegate everything.

    Don't fret about what an object is, fret about what it does. Insisting that stuff inherits from something limits your flexibility and introduces code dependencies that don't need to be there (what if you suddenly realise that your interface base class is badly named? Have you remembered everywhere that that name is used?)