Jeśli jesteś właścicielem tej strony, możesz wyłączyć reklamę poniżej zmieniając pakiet na PRO lub VIP w panelu naszego hostingu już od 4zł!

Stubbles Blog: On annotations and logic

Stubbles Blog: On annotations and logic

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.

Source: http://www.phpdeveloper.org/news/15826

<!–
var d = new Date();
r = escape(d.getTime()*Math.random());
document.writeln('’);
//–>

Posted Styczeń 31st, 2011 in WEB and PHP Development.

One comment:

  1. make money online site web:

    Thanks for posting this. That’s the most full information I have found about this.

Leave a response: