Hi Larz,

On Wed, May 11, 2011 at 3:35 AM, Lars Schultz <lars.schu...@toolpark.com> wrote:
> Am 11.05.2011 00:28, schrieb guilhermebla...@gmail.com:
>>
>> - Entities with knowledge about its persistence information
>
> That must be something I simply have no knowledge about. But isn't it just a
> theoretical difference, because in practice, the "code" being annotations or
> PHP-Code is kept within the class, therefore the entity is not separated
> from its persistence information...but then I don't really understand the
> problem in the first place;)
>

I hope you have OO architecture knowledge.
By having entity implementing an interface/abstract class, you make
your domain classes depending on persistence package.
This dependency breaks OO encapsulation of packages.

By having the code (annotations) within the class you just meta
classify each property/method of your class.
You probably don't know, but annotations that you use in Doctrine
follows a standard document usually referred as JPA (or JSR-317),
second version.
So, you may be surprised, but any persistence tool that follows this
document would be able to support this Entity. One good example is how
ORM package of Doctrine works and you're able to have your Entity
"schemaless" with almost 0 changes in ODM package (read as CouchDB and
MongoDB).

>> - Resources being wasted
>
> Now you sound like Rasmus when he talks about his assembly-history. Do you
> really expect Annotations to perform better than hard-wired php-code?
>

Yes, and built-in support is WAY faster.

>> - You rely on an instance to grab information. Or you use a slow
>> approach of having a static method
>
> This must be something else I do not know. Why is that slower?
>

You should ask to php folks why static methods are slower than
instance methods. =)

>> Also, there are much more things than you can actually think of related to
>> this.
>> The code is not bloated. Since you don't have a "pre-processor"  for
>> class metadatas, you have to build all definitions manually. This is
>> why you have to set inheritance type, for example.
>
> It seems to me that with good default-behaviour, the coded needed could be
> stripped down to what i wrote, since it contains as much information as your
> annotated code.
>
>> FYI, Doctrine took an year of planning an another year of careful
>> implementation of each feature.
>
> Well it's hard to argue with that without stepping on those peoples toes,
> isn't it?;) Is their reasoning process public knowledge? Maybe that'd help
> me understand.

github is there for you to trace the development implementations.
Also we used to have svn too. Initial commits started as soon as php
5.3 were stated. We had an almost usable PR at the time of 5.3 was not
even released. =)

>
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
Guilherme Blanco
Mobile: +55 (16) 9215-8480
MSN: guilhermebla...@hotmail.com
São Paulo - SP/Brazil

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to