zoukankan      html  css  js  c++  java
  • Castle发布新版本

         昨晚群里一位同学说Castle发布了最新版本,上去一看,还真是。不过不是Castle整体发布了新版本,而是它的核心项目,Core,MonoRail,ActiveRecord,Windsor几个项目分别在这个月发布了新的版本.
         关注过Castle的人可能都会觉得Castle更新的也太慢了,MonoRail的一个开发者在这里说明了为什么MonoRail2花费了如此长的时间。我们也大概来看一下,他们大概做了哪些改变:
         1.Core 1.2
             1)Email sender组件集成了进来,并且用System.Net.Mail的MailMessage, Attachment,AttachmentCollection替换了Message, MessageAttachment,MessageAttachmentCollection.
             2)Logging services集成了进来.
             3)发布了四个版本for .NET 2.0, for .NET 3.5, for Silverlight 3.0 and for Mono 2.6
        2. Monorail 2.0
             1)程序化配置可以不采用在Web.Config文件里面,而是直接在Global全局类里面通过程序编码进行配置.

               public void Configure(IMonoRailConfiguration configuration)
            {
                configuration.ControllersConfig.AddAssembly(Assembly.GetExecutingAssembly());
                configuration.ViewEngineConfig.ViewPathRoot = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "Views");
                configuration.ViewEngineConfig.ViewEngines.Add(new ViewEngineInfo(typeof(AspViewEngine), false));
                // configue jquery as the validation engine
                configuration.JSGeneratorConfiguration.AddLibrary("jquery-1.2.1", typeof(JQueryGenerator))
                    .AddExtension(typeof(CommonJSExtension))                 .ElementGenerator
                    .AddExtension(typeof(JQueryElementGenerator))
                    .Done
                    .BrowserValidatorIs(typeof(JQueryValidator))
                    .SetAsDefault();
                // configure url extensions
                configuration.UrlConfig.UseExtensions = false;
            } 


             2)返回值绑定
                可以直接设置 Action的返回值的格式,下面是设置返回Json格式的返回值:

            public class State
    {
    public string Code { get; set; }
    }
    [return: JSONReturnBinder]
    public State[] GetStates()
    {
    return new[] { new State { Code=“CA” }, new State { Code=“WA” } };
    }>


    3)新的路由引擎
    http://www.castleproject.org/monorail/documentation/trunk/advanced/routing.html
    4)RescueController
    用来处理在Action中出现异常的.http://www.castleproject.org/monorail/documentation/trunk/usersguide/rescues.html

       3.MicroKernel/Windsor 2.1.1
              1)最大的改变就是支持Silverlight, 发布了两个版本for .NET 3.5 and for Silverlight 3.0
              2)支持配置文件里配置类型的转向:    

          <component  id="hasForwards"  type="Castle.MicroKernel.Tests.ClassComponents.TwoInterfacesImpl, Castle.MicroKernel.Tests"  service="Castle.MicroKernel.Tests.ClassComponents.ICommon, Castle.MicroKernel.Tests">
    <forwardedTypes>
    <add service="Castle.MicroKernel.Tests.ClassComponents.ICommon2, Castle.MicroKernel.Tests" />
    </forwardedTypes>
    </component>


             3)添加DynamicParameters,添加返回代理,在组件析构时调用.
             4)添加OnCreate,在组件后创建后移除前调用.
             5)添加组件延迟加载. 6)性能优化和bug修复

       4.ActiveRecord 2.1.2
           1)Castle Validator updated to 1.1.1
           2)基于nhibernate进行了相应的更新.
           3)原来AR也集成了NHibernate.Search,NHibernate.Linq等
           ……………………….

      5.扩展开发工具 
           在这里还是介绍一下Castle相关的一些开发工具,虽然现在他们还没有发布新的版本:
            1)ActiveWriter----集成到VS.NET的NHibernate(ActiveRecord)对象可视化设计工具
            2)类似于ROR的Generator
            3)Visual Studio Integration,用来创建项目并且支持NVelocity的智能提示,可以查看这里.
            

          以上列出的新功能并不是包括新版本所有的新功能,只是对官网文档的一些整理。真没想到castle的这些子项目能够更新出新版本,最新版本的可以从这里下载,尤其是MonoRail,能够在Asp.net mvc发布后继承前进,值得支持.以后Castle也可能会只是各个分项目分别更新版本了,发布新版本后,官网的文档也进行了相当的更新,感兴趣的同学可以去官网查看相当的文档以及对应开发者的blog.

    作者:孤独侠客似水流年
    出处:http://lonely7345.cnblogs.com/
    本文版权归作者和博客园共有,欢迎转载,但未经作者同意必须保留此段声明,且在文章页面明显位置给出原文连接,否则保留追究法律责任的权利。

  • 相关阅读:
    python 变量作用域
    python 函数与模块
    python 程序控制结构
    python zip() map() filter()
    python 迭代和列表解析
    python 字典视图
    Matlab程序设计
    Matlab 基本绘图练习 包含极坐标
    Matlab 软件绘图
    Pandas 控制输出格式和精度
  • 原文地址:https://www.cnblogs.com/lonely7345/p/1660437.html
Copyright © 2011-2022 走看看