Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [aspectj-users] ITD - why public ?

Hi Roger,
they don't need to be public, they can be also private, but they are "private to the aspect", that is you will not be able to acess them inside FrameAddress using "this.txtWeb". If you are moving *ALL* the code that perform GUI stuff inside the aspect, then it's not a problem cause inside the aspect those fields can be accessed, if you instead have the code mixed here and there, then you need it to be public.

Recent versions of aspectj changed the way private ITDs are weaved into the target type, now the names are completely preserved, so those fields can be accessed using reflection (for example for JPA and other libraries that use reflection to see which fields are there in a class), but still I would recommend to move ALL the code in the aspect, having those fields private, and having every method that must access those fields inside the same aspect, which reduces coupling a lot.

Hope this helps,
Simone

2010/5/28 Roger Gilliar <roger@xxxxxxxxxx>
I would like to move all code that that is responsible for setting up the gui into an aspect.

The following code seems to work:

   public JdbTextField FrameAddress.txtWeb = new JdbTextField();
   public JdbTextField FrameAddress.txtName = new JdbTextField();
   public JdbTextField FrameAddress.txtVorname = new JdbTextField();
   public JdbTextField FrameAddress.txtOrt = new JdbTextField();
   public JdbTextField FrameAddress.txtStrasse = new JdbTextField();
   public JdbTextField FrameAddress.txtPLZ = new JdbTextField();
   public JdbTextField FrameAddress.txtTelefon = new JdbTextField();
   public JdbTextField FrameAddress.txtFax = new JdbTextField();
   public JdbTextField FrameAddress.txtMail = new JdbTextField();

But why have this declarations to be public ?

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


Back to the top