Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52309 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 53595 invoked from network); 11 May 2011 17:29:26 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2011 17:29:26 -0000 Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.213.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: guilhermeblanco@gmail.com X-Host-Fingerprint: 209.85.213.170 mail-yx0-f170.google.com Received: from [209.85.213.170] ([209.85.213.170:55024] helo=mail-yx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 95/63-36343-577CACD4 for ; Wed, 11 May 2011 13:29:25 -0400 Received: by yxi11 with SMTP id 11so298086yxi.29 for ; Wed, 11 May 2011 10:29:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=7tz+yVswt2raMSlYpWS4wVP/hF8jtD9YftIqr88Y6kk=; b=ilE6J0PmykHxanXfSdRTX1wax3/4Alc1cWlmbEt4DA7rOFrG8VNZB3XUdTkWW3wVwX 5lHmg9NSiT+XJE6uv2FCXwl95hQocpskuNjG9wuAdFONr27an1Cc+uSR5/5JudqLc9Vw qOYVXrXjh9R5I+i+Om5YhWBc8l9T9gpK0dKzI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=A1KIHXjp3ImqeX673S76Rmg4RnxMuuedFLgqpoPF+7eNHlGLkiA/a8lT4QjzmFkRCN lkqA0an5iiGyi2EZi5Zrf/9sOM1/qVLnMj3RJdxikFn6jRxEVWt2NugiSNCbdtnA9ANw 0HOaV+N6vY1R39GH10MPZHn3uIF2y8oHI8w18= Received: by 10.236.183.194 with SMTP id q42mr11401502yhm.43.1305134962209; Wed, 11 May 2011 10:29:22 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.171.4 with HTTP; Wed, 11 May 2011 10:29:02 -0700 (PDT) In-Reply-To: <4DCA2E26.5010202@toolpark.com> References: <4DC826B1.4090806@lerdorf.com> <4DC82A36.8090604@lerdorf.com> <4DC83401.2090202@sugarcrm.com> <4DC8D122.3050507@lsces.co.uk> <4DC8F125.2010503@toolpark.com> <4DC947E3.8070606@toolpark.com> <4DC9B62C.2040009@toolpark.com> <4DCA2E26.5010202@toolpark.com> Date: Wed, 11 May 2011 14:29:02 -0300 Message-ID: To: Lars Schultz Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] annotations again From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") Hi Larz, On Wed, May 11, 2011 at 3:35 AM, Lars Schultz w= rote: > Am 11.05.2011 00:28, schrieb guilhermeblanco@gmail.com: >> >> - Entities with knowledge about its persistence information > > That must be something I simply have no knowledge about. But isn't it jus= t 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 yo= u > 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. =3D) >> 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" =C2=A0fo= r >> 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 b= e > stripped down to what i wrote, since it contains as much information as y= our > 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 hel= p > 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. =3D) > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 Guilherme Blanco Mobile: +55 (16) 9215-8480 MSN: guilhermeblanco@hotmail.com S=C3=A3o Paulo - SP/Brazil