in reply to (jeffa) Re: OO Application Design
in thread OO Application Design

I did something fairly similar recently - to paraphrase my POD (Yay! I'm so glad I wrote it now :-) ):
Person->get(name => "Foo Bar"); Person->get(name => {method => "EQUALS", value=>"Foo Bar"}); Person->get(name => {method => "REGEX", value=>"Foo? Bar"}); Person->get(name => {method => "CONTAINS", value=>"Foo"}); Person->get(age => {method => "GREATERTHAN", value=>18}); Person->get(age => {method => "LESSTHAN", value=>21});

Where the arguments to the get function acted as constraints, i.e. reducing the number of results you'd get back. I'm not certain that it was the way to do it, but it allowed me to forget that I'm not very good at SQL, I'm terrible at schema design, and even the fact the data is stored in an RDBMS.

This approach also had the advantage of having one place to put the SQL, and prevented users from throwing potentially bad SQL at the database, or asking for people that had a name "GREATERTHAN" 24.

Cheers.
davis
Is this going out live?
No, Homer, very few cartoons are broadcast live - it's a terrible strain on the animator's wrist