Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

AOP is doable in most languages that allows very basic levels of runtime instrospection and manipulation of objects and types, and is easy in a large number of them.

In Ruby, for example, "alias_method", "define_method" and "send" is sufficient to implement cross-cutting in a handful lines of code, and at least one generic gem exists that provides basic cross-cutting in a generic way.

But it's very rarely done because it's generally cleaner to pass down code for the library to explicitly call.

I used to be very excited about AOP, but in effect while AOP can be great as a debugging facility (e.g. ability to inject logging at any point for example), when you have control over the design it tends to be better to explicitly build code so that it is designed to accommodate user provided functionality. In Ruby that tends to involve e.g. the ability to pass in blocks a lot of places.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: