Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] [ot] Eclipse AspectJ code snippet


Alex,

Correct.

Matthew Webster
AOSD Project
Java Technology Centre, MP146
IBM Hursley Park, Winchester,  SO21 2JN, England
Telephone: +44 196 2816139 (external) 246139 (internal)
Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx

http://w3.hursley.ibm.com/~websterm/

Please respond to aspectj-users@xxxxxxxxxxx

Sent by:        aspectj-users-bounces@xxxxxxxxxxx

To:        aspectj-users@xxxxxxxxxxx
cc:        
Subject:        Re: [aspectj-users] [ot] Eclipse AspectJ code snippet


#: Matthew Webster changed the world a bit at a time by saying on  10/26/2005 11:07 AM :#
> Alex,
>
> No. At all the insert and update join points "this" is an instance of the
> SimpleInsurance interface. The argument passed however will be a Customer,
> Policy or Claim which is what we want to validate. The declare parents
> snippet on the previous page ensure they implement the RequiresValidation
> interface.
>
> Matthew Webster
> AOSD Project
> Java Technology Centre, MP146
> IBM Hursley Park, Winchester,  SO21 2JN, England
> Telephone: +44 196 2816139 (external) 246139 (internal)
> Email: Matthew Webster/UK/IBM @ IBMGB, matthew_webster@xxxxxxxxxx
> http://w3.hursley.ibm.com/~websterm/

Ohh... I see... looks like I have missed the part where SimpleInsurance is receiving the Customer,
Policy, etc. Sorry about this.

Later on (pg.335):

[quote]
It is worthwhile considering that the this and _args_ PCD can provide, respectively, the same
information that methods thisJoinPoint.getThis() and thisJoinPoint.getTarget() yield but without
the overhead of a reflective call.
[/quote]

This time (hope not to be wrong again :-)), the underlined args should be read target (or am I wrong
again?).

./alex
--
.w( the_mindstorm )p.


> Please respond to aspectj-users@xxxxxxxxxxx
> Sent by:        aspectj-users-bounces@xxxxxxxxxxx
> To:     userAJ <aspectj-users@xxxxxxxxxxx>
> cc:      
> Subject:        [aspectj-users] [ot] Eclipse AspectJ code snippet
>
>
> Hi!
>
> Firstly, I would like to excuse myself for posting the question here, but
> I am not aware of any
> other place where I can do it. Please feel free to point me to the correct
> direction.
>
> Now, my question is about the code snippet at page 293 :
>
> [quote]
> The following pointcut and advice ensure that any time we try to insert or
> update a domain object
> that requires validation, we first validate the object to make sure it
> satisfies the business
> constraints:
>
> pointcut insertOrUpdate(RequiresValidation domainObject) :
>    (execution(* SimpleInsurance.insert*(..)) ||
>     execution(* SimpleInsurance.update*(..)))
>     && args(domainObject);
> [/quote]
>
> Wouldn't this be instead:
>
> [code]
> pointcut insertOrUpdate(RequiresValidation domainObject) :
>    (execution(* SimpleInsurance.insert*(..)) ||
>     execution(* SimpleInsurance.update*(..)))
>     && this(domainObject); // <<< this instead of args
> [/code]
>
> thanks for understanding,
>
> ./alex
> --
> .w( the_mindstorm )p.
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> aspectj-users mailing list
> aspectj-users@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/aspectj-users

_______________________________________________
aspectj-users mailing list
aspectj-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/aspectj-users


Back to the top