-
Enhancement
-
Resolution: Not an Issue
-
P4
-
None
-
5.0
-
x86
-
windows_xp
Name: js151677 Date: 09/13/2004
A DESCRIPTION OF THE REQUEST :
It would be great to have a language enhancement in Java, which allows attaching listeners to ordinary attributes (and to methods) of any class instance. With that mechanism it would be much simpler to build MVC models.
JUSTIFICATION :
This would make Java better than C#
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The runtime performance of a normal attribute change (or method call) should not change, unless at least one listener is attached to it.
Object a = new MyClass();
a.addAttributeListener("attributeName", new AttributeListener() {
public void valueChange(AttributeChangeEvent ev) {
Object ov = ev.oldValue()
Object nv = ev.newValue();
}
}
)
a.addMethodListener("methodName", paramClassArray, new MethodListener()....);
(Incident Review ID: 310509)
======================================================================
A DESCRIPTION OF THE REQUEST :
It would be great to have a language enhancement in Java, which allows attaching listeners to ordinary attributes (and to methods) of any class instance. With that mechanism it would be much simpler to build MVC models.
JUSTIFICATION :
This would make Java better than C#
EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The runtime performance of a normal attribute change (or method call) should not change, unless at least one listener is attached to it.
Object a = new MyClass();
a.addAttributeListener("attributeName", new AttributeListener() {
public void valueChange(AttributeChangeEvent ev) {
Object ov = ev.oldValue()
Object nv = ev.newValue();
}
}
)
a.addMethodListener("methodName", paramClassArray, new MethodListener()....);
(Incident Review ID: 310509)
======================================================================
- relates to
-
JDK-4909261 RFE: built-in support for listener registration and event firing
-
- Closed
-