#25 Improve Eventhandling / Binding with a separate Interface

open
void256
General (44)
3
2012-08-28
2010-05-18
void256
No

Correctly the connection betweeen an onClick="next()" definition in the xml is being resolved via reflection to the appropriate method in the ScreenController.

This works and allows a very flexible combination between the xml part and the java part. However there could be typos or renaming of methods on the java side that will be not detectable until runtime execution.

A possible better way would be to add a special interface for instance:

interface Clickable {
void onClick(String elementId);
}

and automatically route every onClick() event to that method and call it with the element id for instance.

Maybe allow both methods of resolving methods would be possible too, so that the user can choose :)

Discussion

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.





No, thanks