Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:50209 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 10665 invoked from network); 15 Nov 2010 22:43:01 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 15 Nov 2010 22:43:01 -0000 Authentication-Results: pb1.pair.com header.from=pierre.php@gmail.com; sender-id=pass; domainkeys=bad Authentication-Results: pb1.pair.com smtp.mail=pierre.php@gmail.com; spf=pass; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.161.42 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: pierre.php@gmail.com X-Host-Fingerprint: 209.85.161.42 mail-fx0-f42.google.com Received: from [209.85.161.42] ([209.85.161.42:49935] helo=mail-fx0-f42.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 2B/B2-25603-377B1EC4 for ; Mon, 15 Nov 2010 17:43:00 -0500 Received: by fxm13 with SMTP id 13so1770745fxm.29 for ; Mon, 15 Nov 2010 14:42:56 -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=kNmHCOkAy0b9j0LMBisv2Bi014Ix86+TV9LjfpNapio=; b=ZfzxWsxn4dbzL/IOb6Y6SjW2zsN/dmRvgWI1D+57B5SCRJxpRzEUFKiw+i0KRRYjwV GRkfiekZ5WOoI5JpjnBtM/Jtc8V8E6DYyfFyfsUAQ80Q69sI7G77zVbe1IABn+c0DLnE L8ZHc50CMjqu70rlqSVh50e+GUpgbPI0HEeyE= 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=wLN5Skx+0wvXO7BohJ3YTXAi24v+hNpo6nb94hN0DLRJmR/BI7eI/2rPjxVmWW61vZ yOWx8XP8lQqYeSFVaHz6f7LXDB543IkBd9+BCY0YEH/r4TNZZ4Vs/FapnkRN55PqHge2 NE5IR/Rl9OHafnkQjy90ZpU819pCUiBG3YsKY= MIME-Version: 1.0 Received: by 10.223.107.66 with SMTP id a2mr5158958fap.92.1289860975783; Mon, 15 Nov 2010 14:42:55 -0800 (PST) Received: by 10.223.96.7 with HTTP; Mon, 15 Nov 2010 14:42:55 -0800 (PST) In-Reply-To: <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59B588@il-ex2.zend.net> References: <887FE7CFF6F8DE4BB3A9535F53AFD06A2C59B588@il-ex2.zend.net> Date: Mon, 15 Nov 2010 23:42:55 +0100 Message-ID: To: Zeev Suraski Cc: "guilhermeblanco@gmail.com" , PHP internals Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Subject: Re: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) support discussion From: pierre.php@gmail.com (Pierre Joye) hi, The good reason is to actually understand what we are talking about. And seeing phpdoc mentioned in almost all replies tell me that we don't. On Mon, Nov 15, 2010 at 11:22 PM, Zeev Suraski wrote: > I don't see a point in repeating the discussion we've already had on that= topic several weeks ago. =A0There needs to be an overwhelmingly good reaso= n to add a brand new syntax to the language, a whole branch of it in the ca= se of annotations - and there simply isn't. > > Zeev > >> -----Original Message----- >> From: guilhermeblanco@gmail.com [mailto:guilhermeblanco@gmail.com] >> Sent: Monday, November 15, 2010 7:08 PM >> To: PHP internals >> Subject: [PHP-DEV] PHP 5.4 - Meta attribute (aka. Annotations) support >> discussion >> >> Hi folks, >> >> I'll start a series of topics (in this thread) about meta attribute (aka= . >> Annotations) discussion. >> So as soon as we agree on each topic I'll open another point to be discu= ssed. >> Only when we reach some consensus I'll open another topic discussion. >> I suggest to have a poll for each topic, so we can do some democratic >> internals decision. I'd reduce the scope of voters to only people with P= HP >> karma. >> >> The first topic to be defined is: Does PHP need meta attribute support? >> >> Any language is built at the top of syntax, words, semantics and context= . >> We cannot define it as a language if we don't have these 4 parts well fi= t >> together. >> For a simple sentence like: I am all ears, we can easily identify these = parts. >> But the real meaning of this sentence (context) is only achieved with an= other >> part of the language: signifier-significate. >> A signifier is an atomic form, material element, visible, sensitive. >> A significate is an idea, semantic content, conceptual element, not sens= itive >> perceptive. >> >> This important part is only reminded when we get back to semantics, >> specifically when talking about idiomatic expressions, a metaphor in our >> sample. The meaning will only work if we have the context, a known >> information. Our sentence would mean that spoker person only have ears, >> while the true meaning is that he/she is paying attention. >> A computer language doesn't differ from a language by any means. We have >> tokens (words), a syntax, semantic. But the lack of contextualization br= ings a >> hole on language and how your application should behave. This behavior c= an >> be achieved by many different ways; the simplest way is known as meta >> information. >> >> Considering you have a lack of idiomatic expressions knowledge of someon= e >> that is reading. He'd think person only have ears, but if you meta notif= y him >> that it is a metaphor, he'd try to find a different meaning. Example: >> (Metaphor) I am all ears. >> >> Now that we find how meta-information can benefit languages, it is time = to >> understand how meta-information can benefit a computer language. >> >> A good example is define a Service that validates Domain Objects. >> Imagining a scenario where you have a User class that holds email and >> password. Email and password fields must be validated, for example, emai= l >> as an email and password with at least 6 chars. A generic validation ser= vice >> could not have the User validation hardcoded inside the service, so the >> solution would be an external factor that explains to service how to val= idate >> the DO. One of the possible implementations would be a UserValidator cla= ss >> that contains validation rules for each field. This external factor is a= good >> sample of meta-information. But how would a meta attribute would solve >> this situation? >> A Service could simple retrieve the validation instructions by Reflectin= g the >> class which instance is going to be validated. >> Basically, to validate a Domain Object, it is simply required to add val= idation >> rules on desired attributes. Example: >> >> class User { >> =A0 =A0 >> =A0 =A0 protected $email; >> >> =A0 =A0 >> =A0 =A0 protected $password; >> } >> >> *NOTE*: Please understand that this do not enter in any implementation >> details. It is not time (yet) to talk baout docblock, new syntax, etc. >> Scope now is simpler than that. >> >> Now that is possible to see how meta attribute support could benefit a >> language, I compiled a simple list of known projects and how can they >> benefit of meta support: >> - phpUnit Providing meta functionality for test cases, examples: >> @dataProvider for test data iteration, @expectedException for catching >> exceptions, etc. >> - Doctrine For Object-Relational mapping, examples: @Entity, @OneToOne, >> @Id, etc. >> - Zend Framework Server classes Used to automate mappings for XML-RPC, >> SOAP, etc. >> - FLOW3 for dependency injection and validation >> - Symfony2 for validation and routing rules >> - Others: Validation, Functional Behavior injection (which could take >> advantage of Traits), etc. >> >> >> Poll will be opened for voting for 7 days (1 week) starting from now. >> Poll will be closed next Monday at 5pm GMT. >> Question: Does PHP need meta attribute support? >> >> Happy voting! >> >> -- >> Guilherme Blanco >> Mobile: +55 (16) 9215-8480 >> MSN: guilhermeblanco@hotmail.com >> S=E3o Paulo - SP/Brazil >> >> -- >> PHP Internals - PHP Runtime Development Mailing List To unsubscribe, vis= it: >> http://www.php.net/unsub.php > > --=20 Pierre @pierrejoye | http://blog.thepimp.net | http://www.libgd.org