前段时间,学习Monorail和IBatis.Net,写了个小网站,呵呵,查看demo

有一个很强烈的感觉就是使用monorail更像是自己是在写网站,也许能体会到一些php开发者的乐趣。。这是以前用WebForm感受不到的,WebForm开发更像Winform。Castle Monorail + Ibatis.Net一些配置心得

       Monorail和IBatis.Net架构,前期的一些配置还是比较繁琐的,基本的目录结构是这样的
Castle Monorail + Ibatis.Net一些配置心得
大家都知道,Monorail是MVC,他的官方Sample中大致上是Content、Controller、Components、Views、Model这样的目录结构;Content目录中放我们的Js image和css文件。。Controller目录里只我们的控制器,View是我们的定义好的模板文件,Components里是一些自定义组件文件。
    为了使用Ibatisnet,我只好把model拿到外面,变成了和Web同级的目录,这就是上图看到的Entity。。

上图中的的Business、Dao、Entity都是可以利用工具自动生成的。下载这个工具

    下面说说配置文件,还是先看目录结构
    Castle Monorail + Ibatis.Net一些配置心得
  
 Maps目录里Ibatisnet使用的sql语句的config文件,config目录里面放的都是配置文件,全部有
   
   
Castle Monorail + Ibatis.Net一些配置心得

components.config里面是注册我们自定义的component,内容如下。每个comonent id对应的cs代码文件都在在Components目录下面。
Castle Monorail + Ibatis.Net一些配置心得<?xml version="1.0" encoding="utf-8" ?>
Castle Monorail + Ibatis.Net一些配置心得
<configuration>
Castle Monorail + Ibatis.Net一些配置心得    
<components>
Castle Monorail + Ibatis.Net一些配置心得    
<component id="DisplayTopWebsiteComponent"  type="GTTOLCOM.Web.Components.DisplayTopWebsiteComponent, GTTOLCOM.Web"></component>
Castle Monorail + Ibatis.Net一些配置心得    
<component id="HeaderComponent"  type="GTTOLCOM.Web.Components.HeaderComponent, GTTOLCOM.Web"></component>
Castle Monorail + Ibatis.Net一些配置心得    
<component id="DisplayNoticeComponent"  type="GTTOLCOM.Web.Components.DisplayNoticeComponent, GTTOLCOM.Web"></component>    
Castle Monorail + Ibatis.Net一些配置心得    
<component id="FooterComponent"  type="GTTOLCOM.Web.Components.FooterComponent, GTTOLCOM.Web"></component>
Castle Monorail + Ibatis.Net一些配置心得    
<component id="DisplayCategoryComponent"  type="GTTOLCOM.Web.Components.DisplayCategoryComponent, GTTOLCOM.Web"></component>    
Castle Monorail + Ibatis.Net一些配置心得    
<component id="DisplaySiteInfoComponent"  type="GTTOLCOM.Web.Components.DisplaySiteInfoComponent, GTTOLCOM.Web"></component>    
Castle Monorail + Ibatis.Net一些配置心得    
<component id="DisplayPathLinksComponent"  type="GTTOLCOM.Web.Components.DisplayPathLinksComponent, GTTOLCOM.Web"></component>    
Castle Monorail + Ibatis.Net一些配置心得    
<component id="DisplayNavListComponent"  type="GTTOLCOM.Web.Components.DisplayNavListComponent, GTTOLCOM.Web"></component>    
Castle Monorail + Ibatis.Net一些配置心得    
<component id="DisplaySubmitAttentionComponent"  type="GTTOLCOM.Web.Components.DisplaySubmitAttentionComponent, GTTOLCOM.Web"></component>    
Castle Monorail + Ibatis.Net一些配置心得    
<component id="DisplayAddSiteInfoComponent"  type="GTTOLCOM.Web.Components.DisplayAddSiteInfoComponent, GTTOLCOM.Web"></component>
Castle Monorail + Ibatis.Net一些配置心得    
<component id="DisplayUserPathLinksComponent"  type="GTTOLCOM.Web.Components.DisplayUserPathLinksComponent, GTTOLCOM.Web"></component>
Castle Monorail + Ibatis.Net一些配置心得    
<component id="DisplayRssComponent"  type="GTTOLCOM.Web.Components.DisplayRssComponent, GTTOLCOM.Web"></component>
Castle Monorail + Ibatis.Net一些配置心得        
<component id="DisplayTagListComponent"  type="GTTOLCOM.Web.Components.DisplayTagListComponent, GTTOLCOM.Web"></component>
Castle Monorail + Ibatis.Net一些配置心得        
<component id="DisplayAllCommentsComponent"  type="GTTOLCOM.Web.Components.DisplayAllCommentsComponent, GTTOLCOM.Web"></component>
Castle Monorail + Ibatis.Net一些配置心得        
<component id="DisplaySpecialSiteComponent"  type="GTTOLCOM.Web.Components.DisplaySpecialSiteComponent, GTTOLCOM.Web"></component>
Castle Monorail + Ibatis.Net一些配置心得        
<component id="DisplayAddUrlsToolComponent"  type="GTTOLCOM.Web.Components.DisplayAddUrlsToolComponent, GTTOLCOM.Web"></component>
Castle Monorail + Ibatis.Net一些配置心得    
</components>
Castle Monorail + Ibatis.Net一些配置心得
Castle Monorail + Ibatis.Net一些配置心得
</configuration>

Controlloer.config文件内容
Castle Monorail + Ibatis.Net一些配置心得<?xml version="1.0" encoding="utf-8" ?>
Castle Monorail + Ibatis.Net一些配置心得
<configuration>
Castle Monorail + Ibatis.Net一些配置心得
Castle Monorail + Ibatis.Net一些配置心得    
<components>
Castle Monorail + Ibatis.Net一些配置心得    
<component id="home.controller"
Castle Monorail + Ibatis.Net一些配置心得                   type
="GTTOLCOM.Web.Controllers.HomeController, GTTOLCOM.Web" />
Castle Monorail + Ibatis.Net一些配置心得    
<component id="layout.controller"
Castle Monorail + Ibatis.Net一些配置心得                       type
="GTTOLCOM.Web.Controllers.LayoutController, GTTOLCOM.Web" />    
Castle Monorail + Ibatis.Net一些配置心得    
<component id="sitemanager.controller"
Castle Monorail + Ibatis.Net一些配置心得                       type
="GTTOLCOM.Web.Controllers.SiteManagerController, GTTOLCOM.Web" />    
Castle Monorail + Ibatis.Net一些配置心得    
<component id="Browse.controller"
Castle Monorail + Ibatis.Net一些配置心得                       type
="GTTOLCOM.Web.Controllers.BrowseController, GTTOLCOM.Web" />
Castle Monorail + Ibatis.Net一些配置心得    
<component id="Account.controller"
Castle Monorail + Ibatis.Net一些配置心得                       type
="GTTOLCOM.Web.Controllers.AccountController, GTTOLCOM.Web" />        
Castle Monorail + Ibatis.Net一些配置心得        
Castle Monorail + Ibatis.Net一些配置心得    
<component id="FriendLinks.controller"
Castle Monorail + Ibatis.Net一些配置心得                       type
="GTTOLCOM.Web.Controllers.FriendLinksController, GTTOLCOM.Web" />
Castle Monorail + Ibatis.Net一些配置心得    
<component id="Comments.controller"
Castle Monorail + Ibatis.Net一些配置心得                       type
="GTTOLCOM.Web.Controllers.CommentsController, GTTOLCOM.Web" />
Castle Monorail + Ibatis.Net一些配置心得    
</components>
Castle Monorail + Ibatis.Net一些配置心得
Castle Monorail + Ibatis.Net一些配置心得
</configuration>
Castle Monorail + Ibatis.Net一些配置心得


facilities.config的内容
Castle Monorail + Ibatis.Net一些配置心得<?xml version="1.0" encoding="utf-8"?>
Castle Monorail + Ibatis.Net一些配置心得
<configuration>
Castle Monorail + Ibatis.Net一些配置心得
Castle Monorail + Ibatis.Net一些配置心得    
<facilities>
Castle Monorail + Ibatis.Net一些配置心得        
<facility id="rails" type="Castle.MonoRail.WindsorExtension.MonoRailFacility, Castle.MonoRail.WindsorExtension" />
Castle Monorail + Ibatis.Net一些配置心得
Castle Monorail + Ibatis.Net一些配置心得        
<facility
Castle Monorail + Ibatis.Net一些配置心得                  id
="atm"
Castle Monorail + Ibatis.Net一些配置心得                  type
="Castle.Facilities.AutomaticTransactionManagement.TransactionFacility, Castle.Facilities.AutomaticTransactionManagement" />
Castle Monorail + Ibatis.Net一些配置心得
Castle Monorail + Ibatis.Net一些配置心得        
<facility
Castle Monorail + Ibatis.Net一些配置心得          id
="ibatis"
Castle Monorail + Ibatis.Net一些配置心得          type
="Castle.Facilities.IBatisNetIntegration.IBatisNetFacility, Castle.Facilities.IBatisNetIntegration">
Castle Monorail + Ibatis.Net一些配置心得            
<sqlMap id="sqlServerSqlMap" config="config/sqlMap.config" />
Castle Monorail + Ibatis.Net一些配置心得        
</facility>
Castle Monorail + Ibatis.Net一些配置心得        
<facility id="loggingfacility" configfile="config/log4net.config" loggingapi="log4net" type="Castle.Facilities.Logging.LoggingFacility, Castle.Facilities.Logging">
Castle Monorail + Ibatis.Net一些配置心得                  
Castle Monorail + Ibatis.Net一些配置心得              
</facility>
Castle Monorail + Ibatis.Net一些配置心得
Castle Monorail + Ibatis.Net一些配置心得    
</facilities>
Castle Monorail + Ibatis.Net一些配置心得
Castle Monorail + Ibatis.Net一些配置心得
</configuration>
log4Net.config内容
>
providers.configd内容
>
sqlMap.config内容
Web.config
ContainerBLL.cs和GlobalApplication.cs文件,这俩文件存放与Web根目录下面


相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-04-22
  • 2021-05-14
  • 2021-09-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
  • 2021-11-07
  • 2022-02-28
  • 2021-05-14
  • 2021-11-21
相关资源
相似解决方案