On May 2, 2007, at 10:13 AM, John Siracusa wrote:
>> I can write this:
>>
>> reason => SCALAR( 255, DEFAULT '', NOT_NULL, LAZY ),
>
> Cute :)
Nice.
This reminds me of an idea I had a while ago...
I wrote my own form class a few years back, because none of the CPAN
modules could meet my functionality requirements at the time.
One of the things I experimented with, but haven't implemented yet,
was Field Classes -- instead of storing field values as strings, they
would be instantiations of classes. It was an idea I got from a few
python projects.
To better describe this, look at the Rose::Metadata::Column objects
-- imagine if they were subclassed to provide automatic verification
based on user settings.
ie: instead of declaring this :
columns=[
'email_address' => { type="varchar" , length=64 }
]
you would declare:
columns=[
'email_address' => { class="Email" }
]
rose would then look at the Email class and derive the correct setup
information -- ie a varchar column of x size
whenever get/set methods are used, they would instantiate / access an
Email object. the Email object would use overload to display as a
string and seem to function normally -- but contains a validity check
whenever its value is set , and will die/ raise an error if you try
to set an invalid email address.
it might be a little more application specific than rose is, but I
just like the idea of automagically validating fields. maybe for
rose 3.0 ?
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Rose-db-object mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/rose-db-object