Is Ruby on Rails' Active Record an example of Aspect-Oriented Programming?

Posted by B Seven on Programmers See other posts from Programmers or by B Seven
Published on 2012-03-26T12:52:10Z Indexed on 2012/03/26 17:38 UTC
Read the original article Hit count: 256

From Clean Code, about Cross-Cutting Concerns:

Note that concerns like persistence tend to cut across the natural object boundaries of a domain. You want to persist all your objects using generally the same strategy, for example, using a particular DBMS...

Is Active Record an example of aspect-oriented programming?

In AOP, modular constructs called aspects specify which points in the system should have their behavior modified in some consistent way to support a particular concern. This specification is done using a succinct declarative or programmatic mechanism.

If Active Record is an example of AOP, what is the "aspect"? Is it the class declaration that inherits from Active Record?

class Foo < ActiveRecord::Base

© Programmers or respective owner

Related posts about ruby-on-rails

Related posts about clean-code