3 ms·
In my opinion, most OOP languages are not powerful to implement "events" right. The work-arounds often mix up conceptual associations with implementation. For e
by tabtab 8y ago
In my opinion, most OOP languages are not powerful to implement "events" right. The work-arounds often mix up conceptual associations with implementation. For example, if I want to associate an "onClick" event snippet with a given button, how that snippet fits into the UI implementation guts shouldn't normally be the app-coder's concern. Most OOP languages don't have enough power to wire up the conceptual association independent of the implementation associations, and the work-arounds are ugly compromises. As an app coder, I want something like this:
define buttonX inherits button {
buttonAttribute1...
buttonAttribute2...
buttonAttributeEtc...
method onClick() {
doSomethingWhenButtonPressed(...);
}
} // end define
I don't want to have to "register" the event with an observer or whatnot; that's low-level grunt work the framework should normally take care of.
Doing it "right" would require something akin to relational modelling, but there's no current language/IDE that embeds source code into RDMBS well. It's an area ripe for research. Large OOP frameworks don't seem to scale multi-associations well and I find myself looking at RDBMS.