[aosd-discuss] "AOP considered harmful"

Juri Memmert memmert at jpmdesign.de
Mon Apr 25 13:48:12 EST 2005


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Awais Rashid wrote:

Hi all,


>>When giving lectures on AOP I already faced the question of the
>>"encapsulation breaking" issue, 
> 
> 
> This is a question that is often posed to me too. Firstly, IMO, any new way
> of software development promotes a different way of approaching and solving
> the problem one is trying to address. If AOP sidesteps some of the
> encapsulation issues, is it really wrong?
<snip>


I agree with these statements and would like to support them with a few
more items:

- - If you take a look at an MVC implementation, there are implementations
that require quite liberal access restrictions (e.g. none) in all three
classes to perform the tasks as desired.
- - Another issue is that once you have to handle multiple large concerns
within the same application (take the software of an ATM machine, which
is an accounting application, a database application and so forth), you
end up with more liberal access modifiers than you would have if each of
the applications were written as a standalone application.
So yes, if you add database access to the accounting application, you
will break the encapsulation of the accounting application, but if you
were to write both concerns in one application, you'd have weakened the
encapsulation manually... not a good choice.
- - Once you have to deal with multiple concerns in a single class, you
end up with overloaded methods (2+ concerns use the same method) or too
many methods to easily evolve the class. Encapsulating each set of
methods in an individual concern and then merging them together will
most certainly break the encapsulation of each concern in the
overloading case but will increase encapsulation in each concern.

The statement that the encapsulation is broken is true... but that's no
issue, imho, since the entity of interest (the "entity of
encapsulation", if you will) in AOSD is not the class anymore... it's
the concern. Within each concern, encapsulation still holds. Classes are
merely the resulting containers for all the concerns to be merged
together. Of course, here my preference for a system made up completely
of concerns and without a base application comes into play. ;-)


	Juri

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (Darwin)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCbTtsdlXiXRccbPMRAj3dAKCrit6mmIoRBcTXoCioKjwAQkEtwgCfTasp
AgFLDinaUpHs4pJiZv0DgpM=
=TQsX
-----END PGP SIGNATURE-----



More information about the discuss mailing list