问题描述
我今天刚刚看到 Ayende的帖子约PostSharp。我下载了code和尝试过了,我认为这是最酷的,最容易使用的方式来处理AOP,我已经看到了。
I just saw Ayende's post today about PostSharp. I downloaded the code and tried it out, and I thought it was the coolest, most easy to use way to handle AOP that I've seen.
在他的岗位,Ayende说,PostSharp完成它的魔力,通过 IL织造。现在,在一些抽象的层面上,我可以推断出是什么意思,但我想看看是否有一个更详细的答案在那里。不幸的是,第一次在很长一段时间,谷歌来到了空我。所以我想这将是StackOverflow的一个很大的问题(因为我一直在订阅Jeff的博客一对夫妇几年了,知道这个网站是做它的事)。
In his post, Ayende says that PostSharp accomplishes it's magic via IL Weaving. Now, at some abstract level I can deduce what that means, but I wanted to see if there was a more detailed answer out there. Unfortunately, for the first time in a very long time, Google came up empty for me. And so I thought this would be a great question for StackOverflow (since I've been a subscribe to Jeff's blog for a couple years now and knew this site was doing its thing).
那么究竟什么是IL织造,它是怎么做到的呢?
So what exactly is IL Weaving and how is it accomplished?
推荐答案
织是指注射功能集成到现有程序的过程。这在概念上在多个层面进行:
Weaving refers to the process of injecting functionality into an existing program. This can be done conceptually at a number of levels:
- 在源$ C $ C编织将注资源$ C $ C线code编译之前
- 在IL织(用于.NET)增加了code作为IL指令在组装
- 字节code织(用于Java)工程类文件,看到这些评论WRT的
在理论上,你可以走一条更深入,编织编译为本地指令可执行文件,但是这会增加大量的复杂性,我不知道什么,做到这一点。
In theory you could go one deeper and weave with an executable compiled to native instructions, but this would add a lot of complexity and I'm not aware of anything that does this.
这篇关于什么是IL织造?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!