Question

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

No correct solution

Licensed under: CC-BY-SA with attribution
scroll top