Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:49760 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50339 invoked from network); 17 Sep 2010 18:57:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 17 Sep 2010 18:57:16 -0000 Authentication-Results: pb1.pair.com header.from=jbondc@openmv.com; sender-id=unknown Authentication-Results: pb1.pair.com smtp.mail=jbondc@openmv.com; spf=permerror; sender-id=unknown Received-SPF: error (pb1.pair.com: domain openmv.com from 64.15.152.204 cause and error) X-PHP-List-Original-Sender: jbondc@openmv.com X-Host-Fingerprint: 64.15.152.204 mail.ca.gdesolutions.com Received: from [64.15.152.204] ([64.15.152.204:61246] helo=mail.ca.gdesolutions.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 69/F2-30333-B0AB39C4 for ; Fri, 17 Sep 2010 14:57:15 -0400 Received: from localhost (localhost [127.0.0.1]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 004EB5C21 for ; Fri, 17 Sep 2010 14:57:12 -0400 (EDT) X-Virus-Scanned: amavisd-new at gdesolutions.com Received: from mail.ca.gdesolutions.com ([127.0.0.1]) by localhost (mail.ca.gdesolutions.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CYlCFPojauMx for ; Fri, 17 Sep 2010 14:57:12 -0400 (EDT) Received: from djbondc (modemcable083.208-56-74.mc.videotron.ca [74.56.208.83]) by mail.ca.gdesolutions.com (Postfix) with ESMTP id 8EF355C23 for ; Fri, 17 Sep 2010 14:57:12 -0400 (EDT) Cc: "'PHP internals'" References: <12df042bd98b449afa15c788b9083e51@localhost> In-Reply-To: Date: Fri, 17 Sep 2010 14:57:11 -0400 Message-ID: <000001cb569a$232aa220$697fe660$@com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: ActWirwDKtxvFH52R+OfGV0b9U7LwQAAyKeQ Content-Language: en-ca Subject: RE: [PHP-DEV] On how a little knowledge is completely useless. From: jbondc@openmv.com ("Jonathan Bond-Caron") On Fri Sep 17 01:06 PM, Guilherme Blanco wrote: >=20 > Another good example is to map your persistence data into your=20 > Entities. Doctrine 2 implements this and I think that way you can=20 > compare easily with the PHP code alternative. I'd like to ask you to=20 > compate the same Entity mapped through Annotations emulator and using=20 > raw PHP code: > CmsUser using Annotations: > http://github.com/doctrine/doctrine2/blob/master/tests/Doctrine/Tests/ > M > odels/CMS/CmsUser.php > CmsUser using PHP code: > http://github.com/doctrine/doctrine2/blob/master/tests/Doctrine/Tests/ > O RM/Mapping/php/Doctrine.Tests.ORM.Mapping.User.php >=20 You're basically bundling (M: Model, data & configuration, C: Control, = business logic / code) into a single class while the MVC pattern is all = about separating M,V and C. What's wrong with a simple configuration file? Caching the parsed config = in shared memory? One important flaw rarely mentioned with annotations config: your code = now depends on framework X to read the annotations instead of a simple = configuration file (.xml, .ini., ...) Sorry if I might sound harsh but configuration through annotations is = terrible.=20 You'll find many .net or java developers that agree, I'd say it's 50-50 = if not more 70-30.=20 Does this discussion still belong in internals? We could argue about = this for months, java astronauts don't even agree how annotations are = useful: http://www.javaworld.com/community/node/2613