Hi Rodrigo,

--- On Thu, 6/17/10, Rodrigo <[email protected]> wrote:

> From: Rodrigo <[email protected]>
> Subject: Re: A MooseX ORM, an attempt
> To: [email protected]
> Date: Thursday, June 17, 2010, 3:12 PM
> >
> >
> > I do hope to get feedback from the community,
> especially if some people
> > find it useful and is worthy of future work.
> >
> >
> Hi Dexter,
> CPAN namespace considerations aside...
> 
> I really like Moose based ORMs, I think all exercises in
> this direction are
> valid.
> My critique (warning: I've only skimmed thru your readme):
> 
> 1) It would be good to see a mention of KiokuDB in a
> comparison with
> DataMapper.
> KiokuDB is not really an ORM, but it's important to steer
> users on that
> direction
> in case KiokuDB is what they really need.
> 


I'll consider adding KiokuDB in the comparison section, as you pointed out.


> 2) I don't like method-based operators, like "->or", I
> find them hard to
> manage
> programmatically. I prefer parameter based querying, like {
> -or => [ ... ]
> }.

method-based operators are explicit and for readability, allowing one to write 
smaller but manageable expressions. The $queryset->filter() API allows you to 
write expressions as complex as you want. And you have  access to two flavors: 
SQL::Abstract (which should support what you prefer), or a ($stmt,@bind) style.

> 
> As a wishlist (or more like me rambling here), I'd like to
> see a place to
> plug in SQL
> result-sets directly, say:
> 
> package Person;
> ...
> result_set 'underage' => (
>     sql => "select * from person where
> age<18"
> );
> 
> That way difficult queries (ie: outer joins?) or often-used
> queries may be
> easily
> implemented, and special composite (joint) objects may
> exist.


What you are describing sounds like a Repository 
(http://martinfowler.com/eaaCatalog/repository.html), or maybe a plain 
PhraseBook-style object. DataMapper's philosophy encourages encapsulation of 
the session (connection). But you can still write classes with access to the 
session object so that you may encapsulate often used queries. 

> 
> cheers,
> Rodrigo
> 


Warm Regards,

Dex



Reply via email to