Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:52330 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 34446 invoked from network); 11 May 2011 22:06:03 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 11 May 2011 22:06:03 -0000 Authentication-Results: pb1.pair.com header.from=marcelog@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=marcelog@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.210.170 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: marcelog@gmail.com X-Host-Fingerprint: 209.85.210.170 mail-iy0-f170.google.com Received: from [209.85.210.170] ([209.85.210.170:38621] helo=mail-iy0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 3B/68-25254-A480BCD4 for ; Wed, 11 May 2011 18:06:02 -0400 Received: by iyb12 with SMTP id 12so875243iyb.29 for ; Wed, 11 May 2011 15:05:59 -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:date :message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=08xvMjugmxV6Vy3i30v3Cuet45o2k8IOlKkYt/aMIFo=; b=nCBs6W/cSjOeV4EM1riPuTOr3SYxbi76xfEg/63vUs4TmRMrbUy3FNnccACOFp+i59 xeFci8XOTKugAKbF5tUWVE7ZmDUOh9TnIFB5ppjh9Ig9gimRHSKCCmIoqZeW1yWhh3Zs NeBhTmJDfkke8LjCCyyJS9JEzT42m0fM8qBmw= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=cS8NX4D6b5L6XDwglCp4VgtDNKG0rViUCBKZSeQisY8H99oWIMEIQVhxaulgyW3Tut 6f4VzWSu1XfYoYUa9QgtpBuZuZ7KgA0mki8pHHWVfTZZ/FvggwB4gSynrF4+AWW4h9AY lYLakP35/zstgcySqiSgcVQ/st9T7axyCiTYs= MIME-Version: 1.0 Received: by 10.231.177.69 with SMTP id bh5mr6918835ibb.62.1305151559635; Wed, 11 May 2011 15:05:59 -0700 (PDT) Received: by 10.231.6.35 with HTTP; Wed, 11 May 2011 15:05:59 -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 19:05:59 -0300 Message-ID: To: "guilhermeblanco@gmail.com" Cc: dukeofgaming , 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: marcelog@gmail.com (Marcelo Gornstein) is there any chance to add docblocks to arguments in methods and global functions so annotations can be used for them? i.e: public function aMethod(/** @Validate */ UserData $data) { ... } On Wed, May 11, 2011 at 6:57 PM, guilhermeblanco@gmail.com wrote: > 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-docblo= ck > > 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 wr= ote: >> >> 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 separa= ted >>> > 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 acc= eptance of >> the feature=E2=80=94 is that annotations are being seen just as a "cute = feature", >> instead of an architectural advantage to all good PHP code (i.e. OO taki= ng >> advantage of design patterns) and its implications.=C2=A0In summary: the= y 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. D= o >>> > 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 t= hat >> the annotated classes and methods and attributes *NEED* the metadata to = be >> cached in separate PHP code in order to function, otherwise it would be >> practically impossible to use them in production sites; conversely, if t= hey >> were supported natively caching would not be absolutely necessary. Is th= is >> the case?, if so, I think it is a strong use case to be considered for t= he >> 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 de= clined for >> now, perhaps it will be harder to retake for discussion later if it appe= ars >> as declined?. >> > > > > -- > Guilherme Blanco > Mobile: +55 (16) 9215-8480 > MSN: guilhermeblanco@hotmail.com > S=C3=A3o Paulo - SP/Brazil > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > > --=20 -- // I don't sleep. I coffee. "Make everything as simple as possible, but not simpler." -- Albert Einstei= n "The class object inherits from Chuck Norris." "Chuck Norris can divide by zero and can unit test an entire application with a single assert." "There=E2=80=99s a lot of work happening behind the scenes, courtesy of the Spring AOP framework" "Why do I have this nagging hunch that you have no idea what you're doing?" "Any society that would give up a little liberty to gain a little security will deserve neither and lose both" - Benjamin Franklin