2009/10/26 John Toohey <[email protected]>:
> Is is possible to apply a Trait to an object after it has been created? I
> have a situation where I have a collection of object that have been
> populated from a database, and depending on a typeId property, I would like
> to apply different Traits to that object. Each Trait would have the same
> method signatures, but the calculations performs by those methods would be
> different in each case.

It's not possible. A design pattern might better suit your needs. Have
a look at State or Strategy.


-- 
Damien Cassou
http://damiencassou.seasidehosting.st

"Lambdas are relegated to relative obscurity until Java makes them
popular by not having them." James Iry

_______________________________________________
Pharo-project mailing list
[email protected]
http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project

Reply via email to