On Fri Sep 17 03:13 PM, Ralph Schindler wrote: > Inline response: > > On 9/17/10 1:57 PM, Jonathan Bond-Caron wrote: > > On Fri Sep 17 01:06 PM, Guilherme Blanco wrote: > >> > >> Another good example is to map your persistence data into your > >> Entities. Doctrine 2 implements this and I think that way you can > >> compare easily with the PHP code alternative. I'd like to ask you > >> to compate the same Entity mapped through Annotations emulator and > using > >> 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 > >> > > > > 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. > > Jonathan, I think you are misinterpreting this code. There is no > Controller (Front controller, or parameter mapping from $_POST or > $_GET) nor View responsibilities (echo) here. These are all Model > concerns:
I'm not talking about "web mvc" and mapping urls to controllers. There's another pattern where you have a controller (php class) and a data model (sql schema, .xsd, ...) Problem statement: How do I map class properties to a given data model (sql schema, .xsd, ...)? Some believe (strong opinions) that using annotations to do this is not a "good example", though abundant usage in java. It would better serve the discussion if "good" and "bad" was left out and if annotations were presented and promoted in a more neutral way. If we take a more fun example, how is a swiss army knife useful? - It can be used to open cans of food. - It can be used to cut hair. - It can be used to shave in the morning. ... I have full faith in the ability of core developers to make their own opinions on how annotations can be useful to the php community at large. There are more things to be considered then technical arguments. The bigger emerging problem is the complete lack of "formal process" to propose changes to php's syntax: a) How to write a proposal to be accepted for review b) How and by who the proposal will be reviewed c) Who makes the final decision (e.g. executive committee) to approve or reject a proposal. Going back to annotations, the discussions seems to be bouncing from (a) to (c) while it seems like we are still at (a). I've been following internals only for the past couple of years and I don't know enough the history but it seems like it would be time to write a document that defines a "formal process" to propose syntax changes (Zend/zend_language_parser.y, ...?) I'm more than willing to start writing a draft, e.g. a much simplified version of: http://jcp.org/en/procedures/jcp2 Is this worth a try? -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php