in reply to Re: Re: Re: inheritance and object creation
in thread inheritance and object creation

I would like to add the proviso that reblessing should be done
  1. in as few places as possible, preferably in some set of Factory classes that are, by their nature, magical beasts
  2. so as to result in intuitive changes
  3. if nothing else works

Just because you can doesn't mean you should.

------
We are the carpenters and bricklayers of the Information Age.

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.

  • Comment on Re: Re: Re: Re: inheritance and object creation

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: inheritance and object creation
by demerphq (Chancellor) on Feb 25, 2004 at 21:26 UTC

    My personal view is that these rules are too strong. The average code perhaps should have such rules applied, but I think early in the game its ok to decide that various features are to be handled by reblessing. For instance it wouldnt be too difficult to write a parser where the parser state is encapsulated in the class name of the object doing the parsing.

    But on the whole I agree with these as strong recommendations.


    ---
    demerphq

      First they ignore you, then they laugh at you, then they fight you, then you win.
      -- Gandhi