ITD public fields break encapsulation?

View: Old framed views
1 Messages — Rating Filter:   Alert me  
matthewadams12
ITD public fields break encapsulation?
Reply More
Rate this Message:
Reply to author
Print
Show in thread view
Show in list view (by date)
Permalink
This may be a FAQ, but when you are doing compile-time weaving and
introduce a field into classes matching your type expression, that
field is public with a mildly obfuscated name, which I assert breaks
encapsulation.

If I introduce an implementation of an interface into classes, I would
prefer that the private fields and methods supporting the public
methods of the interface be non-public in the introduced class.
Otherwise, when the class is used, a client can directly set the
introduced field(s), which should be encapsulated from the client;
they shouldn't even see them.

Is there a way to introduce interface implementations that don't
change the public interface of the introduced class other than simply
adding the "implements" declaration and the implemented methods?

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