. NET AOP Mini-Framework release--CLEANAOP

Source: Internet
Author: User

cleanaop--Introduction
立地(欧文)邮箱:[email protected]
Lead:

AOP is the abbreviation for Aspect oriented programming. Programming for facets. Code for logging, performance statistics, security control, transaction processing, exception handling, and so on, is separated from the business logic code by separating these behaviors from the non-directing business logic, and then changing the behavior without affecting the code of the business logic.

One: Understanding AOP

In everyday programming tasks, a lot of the code is to do some common functions (log, detection, layer processing, etc.), and then the code is a mechanical copy and paste, the actual business logic code only accounted for a limited share. Then, AOP can better organize common code, and then let a method in a markup way, so that the business logic and common code separation, so that it does not affect each other.

Advantages of using AOP
    • Easy to extend new facets.
    • The business logic is decoupled from the facet logic.
    • Closed for modification, open to expansion.
CLEANAOP supported languages

Version history current version: v1.0.0
    • v1.0.0: Frame completion, support synchronous asynchronous, provide demo plane (Error capture, log, time record), and front and back slice selection.
Where to download?
    1. GitHub Address: HTTPS://GITHUB.COM/JARVIN-GUAN/CLEANAOP#CLEANAOP
    2. NET disk Download: http://pan.baidu.com/s/1dD4pp1f
Demo Test Case
    1. multi-slice, sync

        [trycatchattrubute][logaopattrubute][timeaop]public virtual    void Doword () {throw new Exception ("Error test"); Debug.WriteLine ("123");}  

      Result:

      The
        start catching exception ([Trycatchattrubute]) starts execution ([Logaopattrubute]) 2015/11/5 0:47:19 ([TIMEAOP]) Error test (Exception capture processing) Execution ([ Logaopattrubute]) execution ends, Void Doword () method ([Logaopattrubute]) 2015/11/4 23:47:19 [TIMEAOP])  
    2. Multi-faceted, asynchronous

        [trycatchattrubute][logaopattrubute][timeaop]public virtual async Task Doword () {await getvalueasync (    1234.5123, 1.01);    Debug.WriteLine ("123");    throw new Exception ("Error test"); Debug.WriteLine ("123");}  

      Result:

        Start Catching exception ([Trycatchattrubute]) Start execution ([Logaopattrubute]) 2015/11/5 1:05:23 ([TIMEAOP]) in execution ([Logaopattrubute] ) 123 processing error, error message: Error test ([Trycatchattrubute]) execution end, System.Threading.Tasks.Task Doword () method ([Logaopattrubute]) 2015/11/5 0:05:23 ([TIMEAOP])  

. NET AOP Mini-Framework release--CLEANAOP

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.