nop 2.6

个人觉得这个有点heavy,但却是在微软技术,开发上实践得很好的一个软件。最近更新也很快。

1。把原来使用的一些控件替换了

2。把文件上传的东西,修改了,不依赖adobe flash了

3。code first EF还在使用中:Code-First allows a developer to define entities in the source code (all core entities are defined in the Nop.Core project), and then use EF to generate the database from the C# classes

4。Ioc以及DI还是使用的,在大复杂可扩展的系统中,我始终认为这些是非常必要的。

Figure 2

Figure 3

 

5j解决方案的文件结构基本保持2.5时代

\Libraries\Nop.Core

The Nop.Core project contains a set of core classes for nopCommerce, such as caching, events, helpers, and business objects (for example, Order and Customer entities).

核心基础类,包括常用帮助类,缓存实现,以及重要的业务对象类,比如订单,客户信息等

Nop.Data

数据访问类的集合,基本上根据Nop.core中的商业对象类,试用EF产生了对应的代码。其中:nopCommerces use a fluent code API to fully customize the persistence mapping。

Nop.Services===BAL::业务计算方面的代码

 

        public PriceFormatter(IWorkContext workContext,
            ICurrencyService currencyService,
            ILocalizationService localizationService,
            TaxSettings taxSettings)
        {
            this._workContext = workContext;
            this._currencyService = currencyService;
            this._localizationService = localizationService;
            this._taxSettings = taxSettings;
        }

代码的依赖应该是很少,技术方面不多,业务逻辑方面占比较多。。。。

\Plugins\ 解决方案目录,有用,但设计的方面很多,比如支付插件

Nop.Admin:发布时候要放到Administrative目录下的,项目本身不可作为ie启动项目

presentation layer for admin area. Physically this project is located under \Presentation\Nop.Web\Administration directory. This project cannot be run.

Nop.Web

\Presentation\Nop.Web.Framework

Nop.Web.Framework is a class library project containing some common presentation things for both Nop.Admin and Nop.Web projects.

其实好多内容,包括了一些非商业逻辑方面的帮助类,甚至是htmlhleper的扩展。

 

现在test目录也加入了,如果自己有修改,可以参考现有测试项目,代码进行Unit test。

 

  • Supported operation systems:   
    • Windows 7
    • Windows Vista
    • Windows XP
    • Windows Server 2003
    • Windows Server 2008
  • Supported web servers:   
    • Internet Information Service (IIS) 6.0 or above
  • ASP.NET 4.0 (MVC 3.0)
  • Supported databases:   
    • MS SQL Server 2005 or above
    • MS SQL Server Compact 4.0 or above
  • Supported browsers:   
    • Microsoft Internet Explorer 6 and above
    • Mozilla Firefox 2.0 and above
    • Google Chrome 1.x
    • Apple Safari 2.x
  • Can be run in medium trust (except Excel related features)
  • Adobe Flash (required for picture and file uploading in admin area). Not required sincenopCommerce 2.60
  • MS Visual Studio 2010 or above (with MVC 3.0 installed). Required for developers who want to edit source code

    ==== ====

    Inversion of Control Containers and the Dependency Injection pattern

    http://martinfowler.com/articles/injection.html

     

    // //  //  //autofac go and replace structMap.

    I have no idea what your requirements are, but I bet that Simple Injector can serve you for the lifetime of your project. If you're having trouble with it, just ask here at Stackoverflow.com or contact me directly. I or some of the other users will gladly help you. And don't forget that there are a bunch of users that can help you with general DI problems.

    Of course I would like everybody to use Simple Injector, so please do :-P, but if you ask me which of the other containers I like most, it is Autofac. So it’s a pity, but no shame, if you go for Autofac :-)

    基本步骤:

    Now we will look into the steps to configure Structure Map into our application.

    注册,控制器工厂,初始化

    1. Add Reference to Structure Map
    2. Add Structure Map configuration
    3. Register with the Structure Map Registry
    4. Controller Factory for Structure Map.
    5. Call Structure Map in Global.ascx.

    这些将要或可以被注入的对象/class实例 如何保存,有以下方法:

    Types of Instance Scoping Provided by Structure Map:

    1. PerRequest - The default operation.  A new instance will be created for each request.
    2. Singleton - A single instance will be shared across all requests
    3. ThreadLocal - A single instance will be created for each requesting thread.  Caches the instances with ThreadLocalStorage.
    4. HttpContext - A single instance will be created for each HttpContext.  Caches the instances in the HttpContext.Items collection.
    5. Hybrid - Uses HttpContext storage if it exists, otherwise uses ThreadLocal storage

    使用方式:(从某种意义来说,.net web开发,入伍好多年了)

    Modify Global.asax 
    
    protected void Application_Start() {
    
     
    
      RegisterRoutes(RouteTable.Routes);
    
     
    
       //Configure StructureMapConfiguration
    
     
    
       Bootstrapper.ConfigureStructureMap();
    
     
    
        //Set current Controller factory as StructureMapControllerFactory
    
     
    
        ControllerBuilder.Current.SetControllerFactory( new myFinance.Web.Controllers.StructureMapControllerFactory()
    
     
    
       ); 
    
    
    
    }
    
     
    
    
    
    
    
    The above code will set our controller factory and configure StructureMap configuration when our ASP.NET MVC application is started.
    
    


     

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值