Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Six digests in a single day

Dear fellow subscribers to aspectj-users,

My account is set to digest mode. If I'm not mistaken, the "digest" below is the
sixth I received today.

I'm the only one thinking that "digest" should really mean "daily digest"?

mpm

Em Ter, Setembro 9, 2008 5:01 pm, aspectj-users-request@xxxxxxxxxxx escreveu:
> Send aspectj-users mailing list submissions to
> 	aspectj-users@xxxxxxxxxxx
>
> To subscribe or unsubscribe via the World Wide Web, visit
> 	https://dev.eclipse.org/mailman/listinfo/aspectj-users
> or, via email, send a message with subject or body 'help' to
> 	aspectj-users-request@xxxxxxxxxxx
>
> You can reach the person managing the list at
> 	aspectj-users-owner@xxxxxxxxxxx
>
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of aspectj-users digest..."
>
>
> Today's Topics:
>
>    1. Re: Advice on Constructors With Subclasses (Simone Gianni)
>    2. Re: symmetric vs asymmetric aop (Eric Bodden)
>
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Tue, 09 Sep 2008 16:20:30 +0200
> From: Simone Gianni <simoneg@xxxxxxxxxx>
> Subject: Re: [aspectj-users] Advice on Constructors With Subclasses
> To: aspectj-users@xxxxxxxxxxx
> Message-ID: <48C6862E.7000206@xxxxxxxxxx>
> Content-Type: text/plain; charset=ISO-8859-1
>
> What about this :
>
> public aspect CheckingWithSimplestAspectJEver {
>
>     pointcut constructor(A inst) : execution(A+.new(..)) && this(inst);
>
>     after(A inst) : constructor(inst) {
>         if (inst.getClass().equals(
>         thisJoinPointStaticPart.getSourceLocation().getWithinType()))
>            System.out.println("Done with " +
>               inst.getClass().getSimpleName());
>     }
> }
>
> It works also with classes that instantiate another subclass of A inside
> their constructors, for example delegate classes :
>
> public class Delegate extends B {
>
>     private C another;
>
>     public Delegate() {
>         this.another = new C();
>         System.out.println("Doing stuff in delegate");
>     }
>
> }
>
> new Delegate()
>
> I'm in A
> I'm in B
> I'm in A
> I'm in B
> I'm in C
> Done with C
> Doing stuff in delegate
> Done with Delegate
>
> I think we can happily close the enhancement request, and focus more on
> what the AspectJ API offers :)
>
> Simone
>
>
>
> BiggusJimmus wrote:
>> I am attempting to write some advice that will run only after the
>> construction has completely finished, i.e. after the an object has been
>> completely initialized.
>>
>> An object can be created in any of the types in an inheritance tree, and
>> thus, I would like to advise all of the constructors, but only run the
>> advice once, after the object has been constructed.
>>
>> This is probably easier to describe via an example:
>>
>> public class A {
>>     public A() {
>>         System.out.println("init A");
>>     }
>> }
>>
>> public class B extends A {
>>     public B() {
>>         super();
>>         System.out.println("init B");
>>     }
>> }
>>
>> public class C extends B {
>>     public C() {
>>         super();
>>         System.out.println("init C");
>>     }
>> }
>>
>> after(A item) : execution(A+.new()) && target(item) {
>>     System.out.println(thisJoinPoint.getSourceLocation());
>> }
>>
>> public static void main(String[] args) {
>>     C c = new C();
>>     B b = new B();
>> }
>>
>> The above code has the following output:
>> init A
>> A.java:3
>> init B
>> B.java:3
>> init C
>> C.java:3
>>
>> init A
>> A.java:3
>> init B
>> B.java:3
>>
>> What I am attempting to create is advice that will produce the following:
>> init A
>> init B
>> init C
>> C.java:3
>>
>> init A
>> init B
>> B.java:3
>>
>> i.e. Only run the advice after the object is completely created
>>
>> I have tried a few approaches, including !within(A+.new()) and
>> !cflow(execution(A+.new()), but due to the way the compiler inlines the
>> super() calls, these approaches produce the same results as above.
>>
>> Does anybody have any experience with this problem, and/or suggestions on
>> how to solve it?
>>
>
>
> --
> Simone Gianni
> http://www.simonegianni.it/
> CEO Semeru s.r.l.
> Apache Committer
>
>
>
>
> ------------------------------
>
> Message: 2
> Date: Tue, 9 Sep 2008 10:22:51 -0400
> From: "Eric Bodden" <eric.bodden@xxxxxxxxxxxxxx>
> Subject: Re: [aspectj-users] symmetric vs asymmetric aop
> To: aspectj-users@xxxxxxxxxxx
> Message-ID:
> 	<804e3c660809090722k155cf603m89671c9f3d8bf4ab@xxxxxxxxxxxxxx>
> Content-Type: text/plain; charset=ISO-8859-1
>
> 2008/9/9 Dean Wampler <dean@xxxxxxxxxxxxxxxxxxxxx>:
>> Symmetric AOP is the idea that aspects are used as commonly as classes in an
>> app and that aspects have the same "first-class" nature.
>
> I would even go so far to say that in truly symmetric AOP there is no
> notion of a class any more. Everything is an aspect.
>
> Hope that helps.
> Eric
>
> --
> Eric Bodden
> Sable Research Group
> McGill University, Montréal, Canada
>
>
> ------------------------------
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
> End of aspectj-users Digest, Vol 43, Issue 17
> *********************************************
>


-- 
Miguel P. Monteiro          | cell phone +351 96 700 35 45
Departamento de Informatica | Phone +351 21 294 8536 ext. 10708
Faculdade Ciencias e Tecnol.| Fax: +351 21 294 8541
Universidade Nova de Lisboa | URL: http://ctp.di.fct.unl.pt/~mpm
2829-516 Caparica, PORTUGAL | e-mail: mmonteiro [at] di fct unl pt



Back to the top