Wednesday, February 17, 2010

Adding flexibility to a Framework

We can often extend classes from Frameworks like Flex and Java but about plugging into the Framework in a more dynamic manner? How about taking control of a framework class in a manner that the overridden functionality will be used by anything in the framework that uses the existing class as well?

class Putty {
Putty flexible = null; // possibly improved implementation

frameworkMethod() {
if (flexible != null) flexible.frameworkMethod();
...
}
}

There is nothing ingenious about this other than the fact that IF it was adopted by Frameworks like Flex, it would allow for very powerful changes.

0 comments:

Post a Comment