News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Stubbles Blog:
On annotations and logic
January 28, 2011 @ 12:29:40

On the Stubbles blog there's a recent post that talks about a feature they introduced into the framework - annotations - with high hopes it would give them more flexibility in how things worked. As Frank Keline says, though, "it's not such a good idea at all".

The most simplest reason for this is the idea that annotations are markup. They mark (or, to keep the notion, annotate) code as being special or to be treated in some special kind of way, depending on the scenario where the code is used in. [...] From a design point of view this makes it clear why annotations should not contain logic. If annotations contain parts of such logic, it becomes splitted and possibly cluttered throughout different classes.

He goes on to talk about a second reason why he doesn't think they should be considered first-class in an application - it doesn't promote code reuse. For example, if you define them on a method, there's no way to use that method without them. He puts this into the perspective of the Stubbles framework that currently uses them and how he's changed the logic to live in special classes instead. He considers other changes like places annotations can be used and having different annotation classes.

0 comments voice your opinion now!
annotation logic framework stubbles opinion


blog comments powered by Disqus

Similar Posts

The Bakery: PremierMarinas.com, ScienceHack.com and an iPhone App

Paul Jones' Blog: Lazyweb Request: Why would PHP be *faster* than HTML?

TechChorus Blog: What is your definition of a "True PHP Developer?"

ArsMagnaTutorials: FuelPHP Tutorial Videos

Tiffany Brown's Blog: Debugging tip: "Disallowed Key Character" error in CodeIgniter


Community Events











Don't see your event here?
Let us know!


symfony2 component facebook performance package database install introduction release project security hack framework composer unittest podcast language application example hhvm

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework