I'm used to program to an interface, this makes my code loosely coupled and very extendable. Then I read about mixins and I started to frown. Mixins are classes that define and implement methods so they can be used to add methods on the fly to a new class. Sounds interesting doesn't it?
Start reading: http://www.linuxjournal.com/article/4540
Done reading? Fond of mixins? Did you spot any problems?
Read on: http://www.artima.com/weblogs/viewpost.jsp?thread=246341
And on: http://www.artima.com/weblogs/viewpost.jsp?thread=246483
Last one: http://www.artima.com/weblogs/viewpost.jsp?thread=254367
Now it sounds evil, doesn't it? My conclusion is that mixins are a great way to implement generic behaviour but overuse comes easily. Before using a mixin, try thinking of an alternative!
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment