The short answer is that you are exposing the internals of the object. If you have an object that is just a packet of values, great. If you have an object that will always have e.g. a colour, then possibly great, or possibly not depending on the domain.
On Sat, Sep 27, 2008 at 7:40 PM, Andy Burnett < [EMAIL PROTECTED]> wrote: > I read somewhere - can't remember where - that setters are considered evil. > The argument was that in the real world you can't suddenly change the colour > of a car, just by settings its colour value. Instead, you have to perform > some action, e.g. sprayPaintCar: aColour. Therefore in the OO world, one > should tackle problems in the same way, i.e. if you want to change the value > of an instance variable, you have to call some sort of action method, that > makes sense in the context of the object. > > Without wishing to send startHolyWar to BeginnersList, do any of the > experienced developers work this way, or is it just a theoretical position? > > cheers > AB > > _______________________________________________ > Beginners mailing list > Beginners@lists.squeakfoundation.org > http://lists.squeakfoundation.org/mailman/listinfo/beginners > >
_______________________________________________ Beginners mailing list Beginners@lists.squeakfoundation.org http://lists.squeakfoundation.org/mailman/listinfo/beginners