Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[riena-dev] Binding of Ridgets: Ridget-Setters obsolete?

Hi there!

When a View is bound to a ViewController for the first time, a Ridget is
created for each UI widget and injected into the ViewController. The
injection strategy is defined by an implementation of the interface
IBindingManager. Currently there are 2 implementations:

DefaultBindingManager
- calls the method addRidget of the IRidgetContainer (IViewController)
for each Ridget
- calls a setter (it gets via reflection using the name property of the
UI widget) for each Ridget

InjectAllAtOnceBindingManager
- calls the method addRidget of the IRidgetContainer (IViewController)
for each Ridget
- after all Ridgets are injected it calls the method configureRidgets()
(of the interface IInjectAllRidgetsAtOnce which the IRidgetContainer
must implement) to notify that all Ridgets were added

The method addRidget was added later and appears to make the invokation
of the setters in the DefaultBindingManager obsolete. The setters are a
pretty good place for the individual initialization of a Ridget. But
their invokation is error-prone since it depends on the matching of a
String and a method name which cannot be checked by the compiler.

I would suggest to keep only the InjectAllAtOnceBindingManager and to
rename it to DefaultBindingManager. The interface
IInjectAllRidgetsAtOnce should be removed and its method
configureRidgets() moved to IRidgetContainer.

Are there any objections? Otherwise I would open a bugzilla entry...

Greetings,
Carsten



Back to the top