- 授权协议: Apache
- 开发语言: C#
- 操作系统: 跨平台
- 软件首页: https://git.oschina.net/chejiangyi/BSF.Aop
- 软件文档: https://git.oschina.net/chejiangyi/BSF.Aop/blob/master/README.md?dir=0&filepath=README.md&oid=cbb9fa0d16fd429190a834026f14b2a9016db514&sha=91ac50e53093d5ef6e2241ae0e88191f79053a62
软件介绍
.Net 免费开源,静态 Aop 织入(直接修改 IL 中间语言)框架,类似 PostSharp (收费); 实现前后 Aop 切面和 INotifyPropertyChanged 注入方式。
描述:
项目结构扩展自 BSF 基础架构,但 dll 方面并不依赖 BSF.dll,可以独立开发使用。
项目代码量少(也就几个类文件),核心功能插件化开发,便于第三方扩展,阅读,调试,一起来完善。
.net Aop 静态织入相关的免费开源项目比较少或暂未听闻,故希望开源这块内容,成为同类型开源项目的起点和借鉴。
示例代码:
1) 前后 Aop 切面示例 (详细参考 BSF.Aop.Test 项目)
public class AroundAopTest
{
[MyAroundAop]
[AttributeInfo(Des = "测试2")]
public void Method(TempInfo info, out int b,int a=1)
{
a = 222;
b = 3;
System.Console.WriteLine("Hello world!"+a);
}
}
public static class AroundAopTest2
{
[MyAroundAop][AttributeInfo(Des ="测试")]
public static void Method2(TempInfo info, int a = 1)
{
a = 222;
System.Console.WriteLine("Hello world!" + a);
}
}
public class MyAroundAop : Aop.Attributes.Around.AroundAopAttribute
{
public MyAroundAop()
{
}
public override void Before(AroundInfo info)
{
var att = info.Method.CustomAttributes.ToList()[0];
info.Params["a"] = 55;
System.Console.WriteLine("before" + info.Params["a"]);
}
public override void After(AroundInfo info)
{
System.Console.WriteLine("after"+ info.Params["a"]);
}
}
public class TempInfo
{
public int T1 { get; set; }
}
public class AttributeInfo : System.Attribute
{
public string Des { get; set; }
}2) INotifyPropertyChanged 示例(暂未测试真正使用效果,详细参考 BSF.Aop.Test 项目 )
[NotifyPropertyChangedAop]
public class User
{
public string Name { get; set; }
public int Age { get; set; }
[NoAop]
public int B { get; set; }
}by 车江毅
Web开发敏捷之道
Sam Ruby、Dave Thomas、David Heineme Hansson / 慕尼黑Isar工作组、骆古道 / 机械工业出版社 / 2012-3-15 / 59.00元
本书第1版曾荣获Jolt大奖“最佳技术图书”奖。在前3版的内容架构基础上,第4版增加了关于Rails中新特性和最佳实践的内容。本书从逐步创建一个真正的应用程序开始,然后介绍Rails的内置功能。全书分为3部分,第一部分介绍Rails的安装、应用程序验证、Rails框架的体系结构,以及Ruby语言的知识;第二部分用迭代方式创建应用程序,然后依据敏捷开发模式搭建测试案例,最终用Capistrano完成......一起来看看 《Web开发敏捷之道》 这本书的介绍吧!
