Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] Introduction/mixin

The standard pattern for mixins offers a slightly simpler way to do this.
Declare an interface and an implementation, then declare that the 
target class implements the interface:

  public aspect IBeanImplementation {
   public interface IBean { ... }
   PropertyChangeSupport IBean.support = new PropertyChangeSupport(this);     
   ...
  }

  aspect BeanSupport { 
     declare parents: C implements IBeanImplementation.IBean;
  }
  class C {  }

Since declare-parents takes a type pattern, you can use something like

     interface ITag {}
     declare parents: ITag+ implements IBeanImplementation.IBean;

or 

     declare parents: (C || D || E) implements IBeanImplementation.IBean;

Wes

------------Original Message------------
From: <mohan.radhakrishnan@xxxxxxxxxxxxx>
To: aspectj-users@xxxxxxxxxxx
Date: Wed, Aug-3-2005 5:53 AM
Subject: [aspectj-users] Introduction/mixin
Hi,
        I want to make the properties of a bean bound properties. So if the properties are changed the listener will
be notified. So if I use introductions then I have to hard-code the name of the bean. 

For example if I have to add this

   private PropertyChangeSupport Operation.support = new PropertyChangeSupport(this);

then 'Operation' is hard-coded.

Is this one of the problems that mixins solve ? I'd like to do this without hard-coding the bean name.


Thanks,
Mohan
This message is for the designated recipient only and may contain privileged, proprietary, or otherwise private information. If you have received it in error, please notify the sender immediately and delete the original. Any other use of the email by you is prohibited.
_______________________________________________ 
aspectj-users mailing list 
aspectj-users@xxxxxxxxxxx 
https://dev.eclipse.org/mailman/listinfo/aspectj-users 



Back to the top