开发者

AOP learning resources [closed]

开发者 https://www.devze.com 2023-01-25 12:39 出处:网络
Closed. This question does not meet Stac开发者_JAVA百科k Overflow guidelines. It is not currently accepting answers.
Closed. This question does not meet Stac开发者_JAVA百科k Overflow guidelines. It is not currently accepting answers.

Questions asking us to recommend or find a tool, library or favorite off-site resource are off-topic for Stack Overflow as they tend to attract opinionated answers and spam. Instead, describe the problem and what has been done so far to solve it.

Closed 9 years ago.

Improve this question

I'm new to AOP and I was wondering if there is a good reasorce out there that would help me understand where I can use AOP in my projects.

I work mainly in C# but I'm looking for tutorials about practical AOP and not a specific tool (i.e. PostSharp or other) - I'm looking for common practices/patterns (not tools) and usage examples in any language - not just C#/.NET


So far AOP is tied to frameworks, so you should read the documentation of the AOP framework rather then general approach.

But we can specify three common types of AOP:

  1. pre code injection (in the code file) [code generators that work pior the pre compilation]
  2. runtime code injection (inject, swamp pointers, in memory) [spring?, my own framework]
  3. post code injection [postSharp]

most resources can be found here: "http://csharp-source.net/open-source/aspect-oriented-frameworks"

The most common use is a plugin architecture, logging, caching as well as some domain specific AOP like setting some specific properties on a object that is in a certain domain and state from AOP so that the dev doesn't care about it, other than that presistance layers can use AOP to generate SQL command objects etc.

The thing in AOP is that you need to have a good understanding how the system works if you want to go beyond the common things like Logging, many junior devs don't get AOP so I would be careful with using it in a domain specific way, this will work fine if you are in a strong dev team that has lots of experience with AOP.

EDIT: Here is an good tutorial to spring AOP, Spring is a huge beast, but once you learn it it works very well, the only downside is xml configuration rather then fluent one.

0

精彩评论

暂无评论...
验证码 换一张
取 消