If I could mary a concept it would be AOP this week!!! I LOVE YOU AOP!!!!
AOPAOP 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:
- proxyed (correct word?) / basically mimicking the UserService
- checked some things
- decided to return errors if there were any or...
- call the proceed() function and let the original request finish and return it.
That FREAKS ME OUT!!!!! I LOVE IT!!!!!








Loading....