Login | Register
My pages Projects Community openCollabNet

propel
Reply to message

* = Required fields
* Subject
* Body
Attachments
Send reply to
Topic
Author (directly in email)
Please type the letters in the image above.

Original message

Author hlellelid
Full name Hans Lellelid
Date 2006-05-27 14:21:23 PDT
Message Yes, we simplify the API from the user's perspective (using factory),
but I don't see a clean way to greatly reduce the number of classes
involved. And I don't think that in itself is a bad thing (using many
classes with shared functionality in parent classes seems fairly elegant
in the way it promotes code reuse).

I started thinking of Hibernate's Expression::or() and Expression::and()
... and then realized that 'and' and 'or' cannot be method names in PHP :(

Anyway, we can work with the API. I'll check in a more functional copy
of Criteria2 soon (probably not today, though); that might provide a
better starting point for discussion. In the meantime, there is a
Criteria2.php attached to the wiki page that has some of the
implementation -- albeit in one large file. (Actually, for performance
reasons we may want to keep most of the individual expression classes in
one file.)

I"m building out a Query class right now and reworking the
BasePeer::createSelectSql() method; overall, I'm quite pleased with how
much simpler this new Criteria is, although it's certainly not
functionally complete yet.

Hans

Ants Aasma wrote:
> On the whole the proposal seems pretty good. I hope that I'll have a
> bit more time to think about the design next week and come up with
> more comments. But for now I'd just suggest constructing the
> expression classes with factory methods. This way we could do with
> only a couple of expression classes, cutting down the complexity.
>
> Ants Aasma
>
> On 5/26/06, Hans Lellelid <hans at velum dot net> wrote:
>> Hi -
>>
>> I put together a rough proposal/strategy for a new Criteria API on the
>> wiki page.
>>
>> http://propel.phpdb.​org/trac/wiki/Develo​pment/Criteria
>>
>> The implementation is still only very loosely conceptual and it doesn't
>> address all the functionality of the current system yet. It does,
>> however, provide a more consistent & somewhat more intuitive system
>> (both to use & to develop, in my opinion). The design is based loosely
>> on the Hibernate Criteria API and the way that the logical expressions
>> are handled by Phing's Condition system.
>>
>> I think it's a good starting point, and would be interested in any
>> comments at this point.
>>
>> Hans
>>
>> --------------------​--------------------​--------------------​---------
>> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
>> For additional commands, e-mail: dev-help at propel dot tigris dot org
>>
>>
>
> --------------------​--------------------​--------------------​---------
> To unsubscribe, e-mail: dev-unsubscribe@prop​el.tigris.org
> For additional commands, e-mail: dev-help at propel dot tigris dot org
>