Fog Creek Software
Discussion Board




Utility functions and Aspect Oriented

Andrew Hurst asked a question about Utility Functions last Friday. (http://discuss.fogcreek.com/joelonsoftware/default.asp?cmd=show&ixPost=31915&ixReplies=16)
I have read about Aspect Oriented programming before, but I could not remember the buzzwords. This morning, Slashdot refreshed my memory: http://books.slashdot.org/books/03/03/02/2253212.shtml?tid=108&tid=156
Some links that explain better than I could:
http://www.eclipse.org/aspectj/
http://aosd.net/
Has anyone used this in a real project? It seems like the solution Andrew is looking for.

Doug Withau
Tuesday, March 04, 2003

From my reading of Aspect Oriented Programming, it seems more suited to the "insert debug statements" type programming.  Thats the clearest example I've heard it used for.  They don't affect the flow of the program since they don't change anything if removed.  I wasn't too fond of the example where the routine that started writing out the page in his JSP's would have an aspect to check for the user being logged in.  Didn't seem too intuitive to me.

Regarding whether it did what I was asking before, I don't think so.  The functions/methods I was talking about before were needed but didn't fit in the library.  I don't think you'd set up an aspect to make sure every file path represented as a string had a trailing slash.

Though, anyone around here used AOP?  It sounds interesting, but the possible spaghetti code factor really scares me away from it...

Andrew Hurst
Tuesday, March 04, 2003

In case Aspect Programming is not limited to Java, will you let us know what other language allows for aspect programming?

Li-fan Chen
Tuesday, March 04, 2003

Li-fan, perhaps this would help you...

http://aosd.net/tools.html

Shrinky
Tuesday, March 04, 2003

AOP has been researched in many different environments. In the .NET world there has been some buzz recently on Clemens Vasters' AOP ServicedComponents work.

http://radio.weblogs.com/0108971/2003/02/07.html

Personally I find this interesting but dangerous stuff. If used widely the codeweaving has the potential to trow up some pretty scary hairballs IMHO.

Just me (Sir to you)
Tuesday, March 04, 2003

Check out this ( http://www.iunknown.com/Weblog/WhatsupwithCLAW.html ) response from John Lam on AOP.  Personally I'm working on an AOP-like framework ( http://pinetree-tech.com/weblog/archives/2003/02/18.shtml#000215 ) that doesn't magically add in aspects.  When debugging you would actually step threw the code.  Also you might want to check out extensible C# ( http://www.resolvecorp.com/products.htm ).  It uses attributes to inject code into your objects before a complete compile.  XC# isn't complete AOP, but it gives quite a bit of the benefit without hiding anything.

Justin Rudd
Tuesday, March 04, 2003

Actually, the impact on control flow reminds me of INTERCAL's COME FROM construct.

rwh
Tuesday, March 04, 2003

The general goal of AOP is to isolate system concerns (security, persistence, threading and synchronization, transactions, resource pooling, logging) from the core "business" concerns (manipulating data, business rules) and doing it in a transparent way.  This simplifies code maintainence and makes it easy to integrate new system services with existing business code at deployment time.

AOP techniques are currently common in a lot of Java persistence frameworks.  A lot of Java O/R tools (Hibernate, Castor, OJB) use dynamic proxies or runtime code generation to intercept method calls and save or load objects appropriately.  JBoss 4 is basing its whole EJB implementation on AOP practices.

Colin Evans
Tuesday, March 04, 2003

Beware of Aspect-Oriented programming.  It is patented.

See US patents 6,467,086 and 6,442,750 :

http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL&p=1&u=/netahtml/srchnum.htm&r=1&f=G&l=50&s1=6,467,086.WKU.&OS=PN/6,467,086&RS=PN/6,467,086

http://patft.uspto.gov/netacgi/nph-Parser?Sect1=PTO1&Sect2=HITOFF&d=PALL&p=1&u=/netahtml/srchnum.htm&r=1&f=G&l=50&s1=6,442,750.WKU.&OS=PN/6,442,750&RS=PN/6,442,750

T. Norman
Thursday, March 06, 2003

"It is patented"

What isn't?

Just me (Sir to you)
Friday, March 07, 2003

It's patented by Xerox. If ever a company was guaranteed to drop the ball on innovative technology, it's them.

Chris Tavares
Friday, March 07, 2003

*  Recent Topics

*  Fog Creek Home