Metaclasses vs. standard Python reflection?
Michele Simionato
mis6 at pitt.edu
Fri May 2 09:17:19 EDT 2003
Ian Bicking <ianb at colorstudy.com> wrote in message news:<mailman.1051866424.27998.python-list at python.org>...
> Indeed, people *do* sometimes do code generation in Python, and it would
> be better to change that to metaclasses.
+1
>
> >From what I can tell about aspect-oriented programming (about which I am
> still fuzzy), database and XML wrappers are good candidates for AO
> techniques, and a specific metaclass can implement many of the ideas
> behind AO (though maybe coming from a slightly different angle). But at
> the moment I only have a vague intuition about what problems are
> appropriate for AO programming, ditto metaclasses.
>
> Ian
Some time ago, I read a paper about AOP. Maybe that paper was particularly
bad, but these were my impressions:
1) I couldn't manage to distinguish between the buzzwords and the actual
information;
2) the examples were too abstract and saying nothing to me;
3) the part I understood, I could have implemented trivially with
Python metaclasses, without any need to go through a new programming
language such as AspectJ.
4) I had the impression they were introducing many ad hoc concepts to
solve specific problems, whereas a general purpose solution such as
a metaclass would have solved everything in a much clearer and customizable
way for the final user.
Of course, I only have read one paper and I could well be wrong.
My position (due the reading of that only one paper, could change
in the future) is that the problems AOP is trying to address are
important; nevertheless, that paper did not convince me that the AOP
solution was the right solution.
There is nom doubt that metaclasses are the right solution <0.5 wink>
Michele
More information about the Python-list
mailing list