[Grok-dev] Re: Fields inner class support removed in branch

Jan-Wijbrand Kolman janwijbrand at gmail.com
Mon Sep 17 03:41:31 EDT 2007


Martijn Faassen wrote:
> Note that I personally am not a big fan of this idiom. Various reasons:
> 
> * I like simple attributes instead of properties as they just make 
> reasoning about the code easier. Of course properties are cool, but in 
> moderation.
> 
> * If a form is used, validation of the field will happen twice: when the 
> form is submitted, and then again when the data is set. This seems 
> redundant. :)
> 
> * a vague dynamic typing feeling: I don't want my runtime to do a lot of 
> checks - if I really want to set a property to "foo" I should be able to 
> do it, even if the field doesn't allow it. This isn't very well 
> reasoned, but I got the impression in the past that sometimes it can be 
> limiting to the programmer.
> 
> This is mostly a personal choice though. I don't think we should 
> overemphasize this feature, as in having a culture of "You should be 
> using FieldProperty in your code, you horrible heathen!". I'm fine with 
> offering it as a sometimes useful option to programmers though.

I see your point, but sometimes it has its use.

In any case, I wanted to point out that *we* do not need to implement a 
feature in Grok that sets the default value on a an attribute, because 
there's already a Zope mechanism for it.

regards,
jw



More information about the Grok-dev mailing list