zoukankan      html  css  js  c++  java
  • 介绍一个基于ASP.NET MVC的框架Catharsis

        Catharsis是一个基于ASP.Net MVC的一个开源框架,之前在codeproject上看到的。在我的2011生活看板中也说到今年准备给OpenExpressApp增加B/S支持,所以最近花了几天时间看了一下Catharsis,以下简单介绍一下。

    Catharsis介绍

      Web-application framework, multi-tier (5-tier) Architecture (SQL or XML is persitence, DAO as the only access point to get/store data -NHibernate 3.0, Facades as the only Business rule validation place, MVC pattern (Views on the RAZOR only) and UI (HTML, CSS and JQuery).

    ASP.NET MVC 3.0 RC - Razor,
    The Web-application framework gathering the best practices and design patterns.
    Strongly OOP, multi-tier Architecture, NHibernate 3.0, XML, ADO.NET
    VS 2010, .NET 4.0 (Contracts, Covariance, Named and Default parameters)

    项目地址:http://catarsa.com

    http://www.codeplex.com/Catharsis/

    文档:http://www.codeproject.com/KB/applications/Catharsis_part3.aspx

    主界面:

    架构图

    Solution结构

    根据上面的架构图,从一个示例Solution可以看到各自对应的项目

    通过向导生成实体对应的完整代码

    结合VS,Catharsis提供了Recipe来生成项目代码文件,在生成实体时可以自动生成各个层的对应代码

    Controller继承体系

    以下是框架对实体控制器的一个继承体系,框架特意抽取了一个CodeList来存储具有Code、Name的简单列表的类,这个类可以使用smallint、tinyint来作为主键以减少数据库存储空间

    • CurrencyController:Currency为一个示例实体,这个为特定实体控制器
    • CodeListController:具有Code、Name的一个内置实体控制器
    • EntityController:通用的具有读写行为的控制器(添加、更新、删除)
    • ReadController:通用的具有读取功能行为的控制器(查询、列表、详细信息)
    • WebController:not only for entity, IMasterModel introduced, service operations (ObjectBinding())
    • Controller: ASP.NET MVC框架的控制器

    一些不足

    • 运行比较慢
    • 界面不太美观
    • UI模板抽取不是很好
    • 没有什么太吸引我的地方

    可借鉴的

    • 强OO、多层框架
    • 实体控制类的继承
    • ASP.Net MVC的使用
    • 多语言的支持

    由于没有细看,很多具体实现还有待细看,毕竟我对B/S开发还有很多需要学习的,所以以上分享可能会有偏差

    推荐:你可能需要的在线电子书 

    我的新浪围脖: http://t.sina.com.cn/openexpressapp    

    欢迎转载,转载请注明:转载自周金根 [ http://zhoujg.cnblogs.com/ ]

  • 相关阅读:
    python实现简单爬虫功能
    python re group()
    [转载]python 详解re模块
    Python 异常处理
    Python中os和shutil模块实用方法集锦
    Python中os和shutil模块实用方法集锦
    关于selenium IDE找不到元素
    关于selenium IDE找不到元素
    关于selenium IDE找不到元素
    js模拟点击事件实现代码
  • 原文地址:https://www.cnblogs.com/zhoujg/p/1937647.html
Copyright © 2011-2022 走看看