Simone Gianni wrote:
> Hi Carsten,
> yep, you are absolutely right, no parameters are enought to trigger the
> events. I was thinking about future actions we could implement inside
> this methods, and thought that passing the Binding implementation and a
> generic Object model (it could be a Bean or an XML document) should not
> be harmful.
> 
> Also, these methods could be called from binding implementations OR from
> FOM implementations (javascript Form object and the javaflow Form
> object). I don't know which one is the best : binding implementations
> are contained in the forms block and packages, so that would preserve
> code integrity, but the code would be rather ugly since the
> loadFormFromModel and saveFormToModel can be called by the FOM object or
> from other bindings :
> 
> in every implementation of loadFormFromModel(Widget frmModel, Object
> objModel) :
> if (frmModel instanceof Form) {
>       ((Form)frmModel).loading(...);
> }
> same in saveFormToModel.
> 
> While placing it in FOM implementations produces less (just 2 classes
> ATM) and simpler code, but the FOM object code, which could be in
> another block/package (like javaflow), must call both binding method and
> form triggering methods, which is possibly more error prone.
> 
> You decide :)
> 
Hehe, thanks :) I think it's best placed in the Binding itself, as this
ensures that the event is always fired regardless if you use flow or
not. I think we have to add the code only at one place as the abstract
implementation delegates to a doLoad() method which is overwritten in
all subclasses, but the loadFormFromModel is only implemented once.

I'll implement this later on.

Thanks for the help
Carsten
-- 
Carsten Ziegeler - Open Source Group, S&N AG
http://www.s-und-n.de
http://www.osoco.org/weblogs/rael/

Reply via email to