AOP C # in Action (cont. 1)

Source: Internet
Author: User
Today we start thinking about the C # implementation of AOP, which is confusing for static weavor methods. is the source-level weave done like ASPECTJ, or is it an alternative? I'm going to get a headache from the start.

The AspectJ method is to parse the source code, then insert the ASPCET code at the join point (joinpoint), form the intermediate file, and compile it into the final file. This method produces a better performance, there is a flaw is that if you modify the rules of weaving, you need to recompile. (Some design patterns may be used to eliminate this vulnerability)

Another idea is to use the design pattern at the beginning, insert the delegate at the Jontpoint place, if you need to modify the rules later, you do not need to recompile the source code, as long as you modify the XML aspect description file. The disadvantage is that delegate has a system overhead, so performance is not as good as the previous approach.

Really difficult to choose, is not both ways to support it? Headache ing ...





Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.