in reply to Re: Object selection query
in thread Object selection query

Anonymous Monk is right about the method calls - i am no OOP expert, but this seems a really nasty way to structure your objects and control method calls to them. The whole point of objects is that they look after themselves. Maybe OP could update each class with an 'update' method, which only takes the information it needs, say from a hash like the ones like you describe?

Just a something something...

Replies are listed 'Best First'.
Re^3: Object selection query
by Kraythorne (Sexton) on Jul 21, 2009 at 11:16 UTC
    Oh Dear, looks like I'm not doing too well with my first stab at OOP.

    The methods I'm using in this code are predominantly written so that the method can be used to set or call the value depending on whether you pass it any values:
    sub method{ my ($self) = shift; if (@_){ $self->{MethodName} = shift; } else{ ref $self ? $self->{MethodName} : "An un-named " . $self; } }
    Although I've not been doing this long enough to decide if this is the best way to skin this particular cat

    I'll put in an update method and see how that goes - I guess I just need more practice and direction to get it right. I'm not finding OOP too easy at the moment, need to read a few more books on it me thinks.

    Thanks for the feedback!