#1 2016-04-19 15:43:30

igors233
Member
Registered: 2012-09-10
Posts: 241

AddFilterOrValidate

It seems to me that name of function is a bit misleading, for users with Delphi background first impression is filtering of records.
But this is not the case, it's filtering of field content (trimming) and data transformation (upper/lower case). Perhaps some other name is more appropriate like: AddTransformationOrValidate, AddFieldValueTransformOrValidate.
I know these names have been in usage for a long time and people already using mORMot are used to it but for new users adapting it, it would be good to have a alternative (more descriptive) naming.

Offline

#2 2016-04-20 07:11:22

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,666
Website

Re: AddFilterOrValidate

Indeed...
I understand the confusion...
But changing a method name would be an unexpected breaking change, so would be an even bigger concern...

So I've enhanced the documentation, to explicitly state that TSynFilter would transform the fields input according to some rules.
See http://synopse.info/fossil/info/51102fc37e

Thanks for the feedback!

Offline

#3 2016-04-20 12:52:34

igors233
Member
Registered: 2012-09-10
Posts: 241

Re: AddFilterOrValidate

Thanks, it's much clearer now.
As a suggestion, perhaps consider adding new function with descriptive names and mark current AddFilterOrValidate obsolete, that would enable graceful transition in next few years.

Offline

Board footer

Powered by FluxBB