Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
RE: [aspectj-users] Any useful examples

Why would I want to create a PropertyManager?  By doing so, I'm
unnecessarily creating a dependency.  Now instead of the brittle dependency
on properties, I'm now dependent on a PropertyManager.  In a small example,
no big deal.  With a few hundred of these "little" dependencies, my
application quickly becomes unnecessarily complex and difficult to maintain.

Using the _simple_ AOP solution I demonstrated, my application will work
without any modification if I choose to NOT implement property defaults.  By
using AOP, I make it more usable without adding any dependencies.  I
separate the property defaulting concerns COMPLETELY away from the core
logic of my application.

I would disagree and say that this is a simple example that is not _EASILY_
solved using OO.  It also captures the essence of cross-cutting concerns.

FYI, the original solution was to use a utility class to do all of this.  I
eliminated almost 300 lines of code by using the AOP approach.

> -----Original Message-----
> From: aspectj-users-admin@xxxxxxxxxxx
> [mailto:aspectj-users-admin@xxxxxxxxxxx]On Behalf Of Vankeirsbilck,
> Rudi. (BE - Merelbeke)
> Sent: Friday, August 08, 2003 6:31 AM
> To: aspectj-users@xxxxxxxxxxx
> Subject: RE: [aspectj-users] Any useful examples
>
>
> I don't think this is the example Edward was looking for. There is a
> clean way to solve your problem with plain OO and that is NOT to use
> System.getProperty directly but introduce a PropertyManager (maybe
> singleton) that has one public method getProperty and implements it
> pretty much in the same way as your aspect is doing. But that is besides
> the point because there is a non-aop solution to every problem.
>
> The point that needs to be made is that AOP is just another way of
> modularizing your code and it does this in a partucular that makes it
> easy to deal with cross cutting code. Like with any modularizing
> technique, it makes your code more readable, understandable and
> maintainable and that is why you would use AOP.
>
> Rudi.



Back to the top