Details
-
Type:
Task
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: 0.10
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
Description
The API updates in Binding and the deprecation of BindingContext.ErrorHandler in version 0.10 cause some issues - the API should change again to reflect these issues:
The constructor BindingContext(ValueContainer vc, ErrorHandler eh) is deprecated, due to the deprecation of ErrorHandler (in favor of ChangeListener mechanism). This is nice.
However, the constructor BindingContext(ValueContainer vc) delegates to the first one, adding a DefaultErrorHandler as a second parameter. As this ErrorHandler should being made obsolete by the change listeners, it is of no use and you can only get rid of it by creating a new&empty NullErrorHandler class, implementing a deprecated interface and calling a deprecated constructor.
Thus there's no way to get rid of the DefaultErrorHandler other than using deprecated API.
Suggested fixes (alternatives):
* replace internal ErrorHandler usage by a default ChangeListener that behaves just like the old ErrorHandler did (for backward compatibility purposes) but make this ChangeListener overridable (e.g. by introducing the constructor BindingContext(ValueContainer vc, ChangeListener cl)) (I currently favor this solution)
* Introduce new constructor or static factory method to create a BindingContext without DefaultErrorHandler, just with a ValueContainer
* Break backwards compatibility by not introducing DefaultErrorHandler in constructor BindingContext(ValueContainer vc) (least favorable)
The constructor BindingContext(ValueContainer vc, ErrorHandler eh) is deprecated, due to the deprecation of ErrorHandler (in favor of ChangeListener mechanism). This is nice.
However, the constructor BindingContext(ValueContainer vc) delegates to the first one, adding a DefaultErrorHandler as a second parameter. As this ErrorHandler should being made obsolete by the change listeners, it is of no use and you can only get rid of it by creating a new&empty NullErrorHandler class, implementing a deprecated interface and calling a deprecated constructor.
Thus there's no way to get rid of the DefaultErrorHandler other than using deprecated API.
Suggested fixes (alternatives):
* replace internal ErrorHandler usage by a default ChangeListener that behaves just like the old ErrorHandler did (for backward compatibility purposes) but make this ChangeListener overridable (e.g. by introducing the constructor BindingContext(ValueContainer vc, ChangeListener cl)) (I currently favor this solution)
* Introduce new constructor or static factory method to create a BindingContext without DefaultErrorHandler, just with a ValueContainer
* Break backwards compatibility by not introducing DefaultErrorHandler in constructor BindingContext(ValueContainer vc) (least favorable)