Re: AOP in PHP - Was: OO in PHP

From: Henk Verhoeven (news_at_phppeanutsREMOVE-THIS.org)
Date: 07/09/04


Date: Fri, 09 Jul 2004 23:28:41 +0200

Manuel Lemos wrote:

> The problem with traditional OOP is that as you evolve your library
> classes to make them more flexible, you keep adding code that will
> probably be use just in case.

Hi Manual,

Only if you never rebuild your library. I have rebuilt ours two times
now (that makes three in total). This means that after some years we
reuse the concepts and designs but drop the code. It still kept getting
more powerfull where it is most effective, but it it also gets stripped
from everything that is not the simpelest thing that could possibly work
for the most essential objectives. Therfore it's still only 1.1 Mb
uncompressed.

> That gets worse with cascaded dependencies: classes that get loaded just
> because you used one feature that you want from one class that requires
> other classes to implement features that you do not need.

Not if you ever only include a class if you are going to call its
functions or instantiate it.

> It would be better if you just could tell what features you need and a
> magic generator would generate a class that includes the aspects that
> you really will use at run time.

That would only eliminate about 5 include calls from ca 3 methods per
class. I do not think that would make a big difference it the size of my
code, nor in the number of bugs. But i must admit that i use meta data
for auto inclusion in those cases where i eliminated the code it should
be in entirely ;-)

> You just describe your DAO classes and specify which
> functionality you need.

What else is programming? As i understand it you still need to specify,
that's source code too. I want less source code, i do nog have a
performance problem.

>This is an actual call for Code Generation based solutions
> like Metastorage

Why would you need a code generator for that? Why not simply factor out
the code you now generate?

Sorry, i am just not ready to buy it that AOP would be just a perfomance
issue. To my understanding the case for AOP (and CF likewise) consists
of answers to the above question.

This does not mean that i am agains JIT compilers etc., they can be
great. I just don't think they should be a (meta)language issue.

Greetings,

Henk Verhoeven,
www.phpPeanuts.org.

> Hello,
>
> On 07/09/2004 04:03 PM, Henk Verhoeven wrote:
>
>> Phil Powell wrote:
>>
>> > That reminds me, what is the latest consensus on AOP as opposed to OOP
>> > and is that even being considered within the PHP community?
>>
>> Personally i would rather have some more abstract or low level form of
>> implicit delegation being supported by PHP (directly without
>> precompilation).
>
>
> AOP is not different and OOP. It is just a way to make more efficient
> software (read not so bloated) by only including the Aspects that you
> really want in the software that you load at runtime.
>
> The problem with traditional OOP is that as you evolve your library
> classes to make them more flexible, you keep adding code that will
> probably be use just in case.
>
> That gets worse with cascaded dependencies: classes that get loaded just
> because you used one feature that you want from one class that requires
> other classes to implement features that you do not need.
>
> It would be better if you just could tell what features you need and a
> magic generator would generate a class that includes the aspects that
> you really will use at run time.
>
> This is the approach of Metastorage Data Access Object (DAO) classes
> generator. You just describe your DAO classes and specify which
> functionality you need. Then it just generates JE WIN code (Just Exactly
> What I Need). For instance, if you will never need to delete persistent
> objects, Metastorage will not generate delete object functions.
>
> The result is more compact software that loads faster at run time and
> saves memory. This is an actual call for Code Generation based solutions
> like Metastorage which implements a black box approach for AOP. There
> are also white box approaches to AOP based on code insertion on existing
> code.
>
> You may find more about Metastorage here:
>
> http://www.meta-language.net/metastorage.html
>
>



Relevant Pages

  • Re: Using "custom attributes"
    ... I am analzing the AspectDNG, i would like to weave my custom attribute, ... Attributes only make sense in conjunction with one or more features. ... 2)AspectDNG AOP Framework ... AspectDNG uses static AOP, were the magic happens during the extra build ...
    (microsoft.public.dotnet.framework.aspnet)
  • [ANN] PLCash 2.0 released
    ... It sports many new features including a powerful report ... generator. ... Download at http://www.arachnoid.com/PLCash, and please tell me what you ...
    (comp.lang.java.help)
  • [ANN] PLCash 2.0 released
    ... It sports many new features including a powerful report ... generator. ... Download at http://www.arachnoid.com/PLCash, and please tell me what you ...
    (comp.os.linux.misc)