Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52329 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 32803 invoked from network); 11 May 2011 21:58:24 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2011 21:58:24 -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.42 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.42 mail-yw0-f42.google.com Received: from [209.85.213.42] ([209.85.213.42:56187] helo=mail-yw0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 20/28-25254-B760BCD4 for ; Wed, 11 May 2011 17:58:19 -0400 Received: by ywh1 with SMTP id 1so399151ywh.29 for ; Wed, 11 May 2011 14:58:16 -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=SL1Qq6qiXKQ2JUZTI0x/dABbaDQD0kkyPrpffm0gkc0=; b=XiBkmIMdScYSK1RzrySGdmGFO3sXGXnBi2PzF2TOQDZ3ca+PK393xLtp8NRohklsxO ewekaGYknLb43XMVfIGRd4K9A+pzRGQdhrkNu3vT0EtEsm7bId3+u+sAqRXZY8x7mw8B UpHhP/Za5a+/4e5mPu5wbGYhEyWeZ4xIi0X1I= 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=XxVyMJhhLCK2mlVWTmmo/cbkOLHv5FqtW5H567IFiI5YXqzjjYz5uuPbjeJqQPacdV Bsg/wKVKsWtiK6e/8V47ob9BY2tm7vTKtAS1F3002YCSW/8kkxendO7miGxejh7B2HqS LmhLIe4Ph/b8cVjCsekdLBU0iPY4Gfxb/laO8= Received: by 10.150.53.13 with SMTP id b13mr8057267yba.90.1305151096130; Wed, 11 May 2011 14:58:16 -0700 (PDT) MIME-Version: 1.0 Received: by 10.147.171.4 with HTTP; Wed, 11 May 2011 14:57:56 -0700 (PDT) In-Reply-To: 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 18:57:56 -0300 Message-ID: To: dukeofgaming Cc: Lars Schultz , 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 duke, I moved it to rejected in pro of a new proposal. I briefly drafted it here: https://wiki.php.net/rfc/annotations-in-docblock There's a lot of things to be officially defined, but basic idea is there. I expect to have a chat with interested core devs to see what can be done in this subject and find some common sense. =3D) Cheers, On Wed, May 11, 2011 at 6:54 PM, dukeofgaming wrot= e: > > On Wed, May 11, 2011 at 12:29 PM, guilhermeblanco@gmail.com > wrote: >> >> Hi Larz, >> >> On Wed, May 11, 2011 at 3:35 AM, Lars Schultz >> wrote: >> > 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 >> > just a >> > theoretical difference, because in practice, the "code" being >> > annotations or >> > PHP-Code is kept within the class, therefore the entity is not separat= ed >> > 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). > > I think part of the problem on the discussion =E2=80=94regarding the acce= ptance of > the feature=E2=80=94 is that annotations are being seen just as a "cute f= eature", > instead of an architectural advantage to all good PHP code (i.e. OO takin= g > advantage of design patterns) and its implications.=C2=A0In summary: they= are > huge. If simple reflection can tell the developers what the code is, > annotations let them know what it can be in depending on their context (i= .e. > behavior is decoupled). >> >> >> - 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. > > If I'm not mistaken, the current comment-parsing solutions are so slow th= at > the annotated classes and methods and attributes *NEED* the metadata to b= e > cached in separate PHP code in order to function, otherwise it would be > practically impossible to use them in production sites; conversely, if th= ey > were supported natively caching would not be absolutely necessary. Is thi= s > the case?, if so, I think it is a strong use case to be considered for th= e > RFC. > BTW, why is it rejected in the wiki now?. Is it completely completely > rejected?, or just postponed?... if it is just=C2=A0cataloged=C2=A0as dec= lined for > now, perhaps it will be harder to retake for discussion later if it appea= rs > as declined?. > --=20 Guilherme Blanco Mobile: +55 (16) 9215-8480 MSN: guilhermeblanco@hotmail.com S=C3=A3o Paulo - SP/Brazil