Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50367 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 55653 invoked from network); 18 Nov 2010 18:05:55 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 18 Nov 2010 18:05:55 -0000 Authentication-Results: pb1.pair.com header.from=guilhermeblanco@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=guilhermeblanco@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.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.161.170 mail-gx0-f170.google.com Received: from [209.85.161.170] ([209.85.161.170:53742] helo=mail-gx0-f170.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 9B/C0-01108-10B65EC4 for ; Thu, 18 Nov 2010 13:05:53 -0500 Received: by gxk3 with SMTP id 3so111173gxk.29 for ; Thu, 18 Nov 2010 10:05:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=/pqhMRatu1yHfwhkZESy+Y402SrcUIlRyLLf7+YKmBw=; b=Q5dsethBD8EVGhTQ/+WiqlrZKt7eoSnADIP9zujPb6SmMuS/tS0g92YxpjuJsGFMDK eZY6NRhZkW03dg7lIVL/ZFtiHSypx/G4/5XCTeh7lPQgWjSJWqXtrcfktyiqeElKNFKt lvDbE0geoJd42G5VH7p9tILxAtqk13m77M/Ww= 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=LNiolB4WJuMpSzDZLhNGgjsnaiBgmbtuDEOrsSYY3Ne54Q05w5dWq08Bz8sv0+XOBC JQ1qv5AfWtOoYzRoJfKsch/4M9mQjdtxqxtWYGnNH0ar3ezRB57Zt+8DhutZD7y21yc4 mZaeNp35sIzxJBpSEUl0FEDxD/vzgqBWCnf/o= MIME-Version: 1.0 Received: by 10.223.123.209 with SMTP id q17mr865319far.126.1290103546388; Thu, 18 Nov 2010 10:05:46 -0800 (PST) Received: by 10.223.105.5 with HTTP; Thu, 18 Nov 2010 10:05:46 -0800 (PST) In-Reply-To: <4CE55BBC.4050900@garfieldtech.com> References: <201011172316.44702.larry@garfieldtech.com> <4CE55BBC.4050900@garfieldtech.com> Date: Thu, 18 Nov 2010 16:05:46 -0200 Message-ID: To: "larry@garfieldtech.com" Cc: internals@lists.php.net Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) support discussion From: guilhermeblanco@gmail.com ("guilhermeblanco@gmail.com") Hi Larry, Of course I know how it can benefit a full stack framework. For example Zend Framework can benefit of it by auto-generating WSDL files in Zend_Soap. You're right about Symfony integrated system of property validation of Domain Objects. If you would like to see how it would be implemented in Doctrine/Symfony without Annotations, here are the links of them: Doctrine sample user class: https://github.com/doctrine/doctrine2/blob/master/tests/Doctrine/Tests/ORM/= Mapping/php/Doctrine.Tests.ORM.Mapping.User.php Symfony injection of property validation: http://docs.symfony-reloaded.org/guides/validator.html (at the end of HTML file) Cheers, On Thu, Nov 18, 2010 at 3:00 PM, larry@garfieldtech.com wrote: > On 11/18/10 7:34 AM, guilhermeblanco@gmail.com wrote: >> >> Hi Larry, >> >> For existent project examples and usage, here are 2 links of the >> upcoming versions of Doctrine 2 and Symfony 2: >> >> >> http://www.doctrine-project.org/projects/orm/2.0/docs/reference/basic-ma= pping/en#introduction-to-docblock-annotations >> http://docs.symfony-reloaded.org/guides/validator.html >> >> Please understand that Roman, Benjamin, Jonathan and I wrote this >> Annotation parser for Doctrine, which was reused by Bernhard on >> Symfony. >> So I have clean understanding of the issue we have on hands and every >> single point that it is required to address. That's why I wrote the >> RFC. >> >> Yesterday night a couple of people joined on #php.pecl and discussed a >> possible new implementation. >> I'll write what was discussed and probably some sample code. > > No offense, but as I've noted before Symfony and Doctrine are very very > different types of frameworks/libraries than a lot of the code out there. > =C2=A0Much of what may make sense in a component framework doesn't make s= ense in > a full stack framework (e.g., Drupal, which I work on) and vice versa. = =C2=A0So > while I respect that you put a lot of work into the Doctrine and Symfony > implementations that does not mean you will understand "every single poin= t > that it is required to address". > > That said, from looking at the Symfony page above it looks like it's an > integrated system for providing variable-level validation. =C2=A0True? > > If that's the case, what would a before/after look like for code using > annotations vs. not? > > As far as implementation goes, for something like this to be useful for a > highly-dynamic system like Drupal we'd need to be able to add > annotations/validation rules out-of-band, that is, from somewhere other t= han > syntactically right on the variable/function/method being validated. =C2= =A0We > frequently have highly-generic objects that get used in a multitude of > different ways, so we would need to be able to associate validation rules= at > runtime for them to work. > > Naturally the error messages from them would also need to be > returned/thrown, not printed, so an application can take proper steps wit= h > them in its own error handling routines. > > --Larry Garfield > > -- > 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