From: Keith Sader Date: 2006-03-31T13:01:48+09:00 Subject: Re: Ruby and AOP On 3/30/06, James Herdman wrote: > I'm reading "The Pragmattic Programmer" right now and I'm at the part > about orthogonality. The authors mention AOP and give an example > involving log writing wherein you can "weave in" some AOP ("Aspect > Oriented Programming" for those not in the know) sexiness and log > writing occurs (the converse behaves as you might expect)**. > > It seems to me that this behavior is *sort* of like a mixin -- i.e. you > can mix it in for a new behavior. However, AOP code seems to be > triggered when certain actions happen. > > Does this sound roughly correct to those who have AOP experience? Have > any of you used AOP in your experience, and if so, where has it been > most beneficial? > Yes, it's like a mixin but on more than a 'class' level. It's cross-cutting(to use the jargon) across class hierarchies. Basically AOP allows a further and different separation of concerns in a software system. Think of transactions and security as better uses of AoP. An object should be able to participate in a transaction without ever knowing it's been in one. Log writing is the 'Hello World' of AoP. I've used AoP for Logging and exception tracing at runtime of working systems. Ron Bodkin and Ramnivas Laddad have excellent blogs on AoP. hth, -- Keith Sader ksader@gmail.com http://www.saderfamily.org/roller/page/ksader