in reply to Re: OO theory question
in thread OO theory question

basically option 1 then. in that context, would it make more sense to have the ->new method do a simple bless, and implement another method, perhaps ->connect, that creates connections as properties of the object returned by ->new?

Replies are listed 'Best First'.
Re: OO theory question
by Abigail-II (Bishop) on Jun 09, 2004 at 16:49 UTC
    IMO, a constructor should only construct, and not do anything else. Otherwise, your subclassing classes will be forced to call your constructor, and that's a major pain in the ass if the subclass wants to do MI.

    Abigail

      so, to sum it up. 1 constructor that does just that, construct. 1 method to add a connection, and 1 final method which is called once that starts the main loop and gets everything running?
        I'd start the main loop from the main program. Calling a method in a connection object (which one?) to start the main loop doesn't sound logical to me.

        Abigail