I have seen many times, we have to give needless extensions to our classes for the sake of using a framework. Evident quite enough, this makes our classes glued to the framework. I spend my precious time designing my classes and taking of all the precautions I can, to make it reusable, reusable many will consider as an over rated thing, but I think they need to do some serious stuff before even thinking that way. If you think in a proper direction many of your artifacts YES can be reused. I have done that and seen people do that.
Well back to the point, but at times flexibility built right into the language can be silver bullet for many causes. Have a look at the code snippet above. I have two modules module A and module B, I have one class Foo.
Now I want to add behavior into the instance of class Foo and the class Foo itself. Easiest way possible extend to a fraking SUPER class and have fun and worship it as your DSL, losing all the flexibility to the LORD. As your LORD is one ruling you wont mind sacrificing to the stickiness, but growth in different fileds sooner or latter might change the things.
So what to do? sagasious latteral thinking lead me to above solution. I coud add methods without touching my class. Ruby has beautiful methods to kill the burden of the LORD.
Rest is just another story.... !!!! Have Fun ..... !!!!!
Well back to the point, but at times flexibility built right into the language can be silver bullet for many causes. Have a look at the code snippet above. I have two modules module A and module B, I have one class Foo.
Now I want to add behavior into the instance of class Foo and the class Foo itself. Easiest way possible extend to a fraking SUPER class and have fun and worship it as your DSL, losing all the flexibility to the LORD. As your LORD is one ruling you wont mind sacrificing to the stickiness, but growth in different fileds sooner or latter might change the things.
So what to do? sagasious latteral thinking lead me to above solution. I coud add methods without touching my class. Ruby has beautiful methods to kill the burden of the LORD.
Rest is just another story.... !!!! Have Fun ..... !!!!!