0

If I could mary a concept it would be AOP this week!!! I LOVE YOU AOP!!!!

AOP

AOP is the coolest thing ever, especially for a knuckle head like me.

I know I am repeating myself, but Big Dave Shuck pointed out the new code features of InstantSpot, and I am sooooooo excited about AOP that I had to post again about why AOP saves lives.

I dislike adding new code to old code if the new stuff has nothing to do conceptually with the old stuff.

A basic problem which I will never face again is: where to put security, and by security I mean type checking and validation.

I will put it in my "aspects" folder and I will call it Validation.cfc. Here is a better example than a couple of days ago:

Lovely Little form:

And here is the simple controller:

Now the ask the UserService to update:

BUT WAIT!!!!! NOT NOW!!!! LETS MethodIntercept this method!!!!!!!

The lovely ColdSpring super easy XML document commented:

The Great MethodInterceptor:

So now if my application asks to "updateUser" my controller code "thinks" its asking the UserService.cfc to do it, but its not. ColdSpring is the one "doing it". It has:

  1. proxyed (correct word?) / basically mimicking the UserService
  2. checked some things
  3. decided to return errors if there were any or...
  4. call the proceed() function and let the original request finish and return it.

That FREAKS ME OUT!!!!! I LOVE IT!!!!!

tags:
AOP
0

AOP SAVES LIVES!!!

AOP

Period!

Code example to come.

Thanks bazillions ColdSpring , you make me feel like i just learned Model-Glue for the first time, and THAT's hard to do!

THANK YOU!!!!!

tags:
AOP

Search