[jala-dev] Re: AW: Further feedback on jala.Form

  • From: <robert.gaggl@xxxxxx>
  • To: <jala-dev@xxxxxxxxxxxxx>
  • Date: Thu, 10 May 2007 15:21:09 +0200

> >  1. I noticed that it's the "require()" method vs the 
> > "required" declaration; no tragedy, but in the first place I 
> > entered "require" in the form object structure. maybe, you 
> > could indeed rename the latter to "required"?
> Intuitively, I'd say a the name of method describes an action 
> and should
> therefore be a verb, whereas a the field names describe a state and
> should so rather be an adjective ("invalid", "required"). Yet, most of
> the other markers ("maxlength", "maxwidth") don't really fit with that
> scheme anyway, so I'd be fine with changing that to "require"
> everywhere. Any other opinions?

i'm fine with that.

> What about having getter and setter properties (validator too?) at the
> form object? By default this methods would do what get/setValue method
> currently does: Returning or setting the properties of the 
> data object.
> If you change form.getter or form.setter you can change the default
> behaviour, if you change the component's getter/setter 
> functions you can
> specify individual behaviour.

i find it confusing to define the default getter/setter for components
in the form object, where it's actually neither used nor needed
(getValue/setValue is currently defined in jala.Form.Component where it
imo belongs to). plus it adds quite some intransparency to a component's
behaviour, as you'll have to keep the fallback in mind.

personally i can perfectly live with the current situation: creating two
standard custom getter/setter methods statically and assign them in the
form config at every component that needs it isn't imo a big burden,
plus it makes clear that those components use a custom getter/setter.

> > Finally, I still think we need to find better names for the 
> > following methods / properties, and this time I provide some 
> > proposals:
> > 
> >  * setDataObj - what about "setSource"? or at least: 
> "setDataObject"?
> Not sure about these: it's not just the "source", it's the target too.
> Data object would be ok with me because that's pretty much what it is,
> for naming the methods getObject/setObject could be enough.

i vote for setDataObject()

> So, I'd suggest sticking to html and the attribute-name of the submit
> button's text: setSubmitValue()



Other related posts: