ASP.NET Boilerplate
I want it to be a start point for all we .NET developers, so, it will be good to develop it together.
特点:继承、自动、约定、扩展
领域层:领域实体、业务规则、操作数据库、
应用层:单元操作、数据传输对象、输入输出对象、应用服务(接口与实现)
Domain layer
In the Domain Driven Design (DDD), the core layer is the Domain Layer. Domain Layer defines your Entities, implements your business rules and so on.
Application layer
Application layer does not include domain information and business rules in an ideal application (this may not be possible in the real life but we should minimize it). It mediates between presentation layer and domain layer.
Notice that I did not call _taskRepository.Update or any other method to save changes to database. Because, an application service method is a unit of work as default in ASP.NET Boilerplate. For a unit of work method, it basically opens a database connection and begins transaction at the beginning of the method and saves all changes (commits the transaction) to database at the end of the method automatically. It rollbacks the transaction if an Exception is thrown in the execution of the method.
application layer depends only domain (core) layer of the application
DTO Validation:
Validating the user input is an application-layer task.
An application service method should validate inputs and throw exceptions if given input is not valid.
But an Application service is a plain class, not derived from Controller. Fortunately, ABP provides similar mechanism for ordinary application service methods (using Castle Dynamic proxies and interception).
One more thing: ABP checks if input parameter of a service method is null. So, you don't need to write guard clauses for that.
I advice to create seperated input and output classes for each application service method even it has only one input argument. This is good when extending the application by adding other arguments to this method. It provides a way of adding parameters to the application service method without breaking existing clients.
开始吧!
ASP.NET Boilerplate的更多相关文章
- Asp.net Boilerplate源码中NotNullAttribute的用处
看Asp.net Boilerplate 1.1.3.0源码时发现有一个NotNullAttribute的定义和27处的引用,就是不知道它的作用,当然顾名思义是可以的,就是不知道它是怎么判断的,在哪里 ...
- ASP.NET Boilerplate终于发布v1.0了
(此文章同时发表在本人微信公众号"dotNET每日精华文章",欢迎右边二维码来关注.) 题记:ABP经过2年多的开发,终于发布第一个主要版本了,谨此提醒ABP的使用者. ASP.N ...
- ASP.NET Boilerplate 深入系列之:概述
因为项目需要,最近个人购买了一直在研究的ABP框架的一个Regular Licience,马上要用到一个实际的项目中,为了能够准确把握该框架涉及到设计思想.使用模式.内在实现细节.准备在接下来的一个月 ...
- ABP+AdminLTE+Bootstrap Table权限管理系统第一节--使用ASP.NET Boilerplate模板创建解决方案
"abp是ASP.NET Boilerplate简称,是一个用最佳实践和流行技术开发现代WEB应用程序的新起点,它旨在成为一个通用的WEB应用程序框架和项目模板" abp官方网站: ...
- 如何使用ASP.NET Core、EF Core、ABP(ASP.NET Boilerplate)创建分层的Web应用程序(第一部分)
本文是为了学习ABP的使用,是翻译ABP官方文档的一篇实战教程,我暂时是优先翻译自己感兴趣或者比较想学习的部分,后续有时间希望能将ABP系列翻译出来,除了自己能学习外,有可能的话希望帮助一些英文阅读能 ...
- 十一、ASP.NET Boilerplate
一.ASP.NET Boilerplate 实体是 DDD(领域驱动设计)的核心概念之一.Eric Evans 是这样描述的“很多对象不是通过它们的属性定义的,而是通过一连串的连续性事件和标识定义的” ...
- ASP.NET Boilerplate 学习 AspNet Core2 浏览器缓存使用 c#基础,单线程,跨线程访问和线程带参数 wpf 禁用启用webbroswer右键菜单 EF Core 2.0使用MsSql/MySql实现DB First和Code First ASP.NET Core部署到Windows IIS QRCode.js:使用 JavaScript 生成
ASP.NET Boilerplate 学习 1.在http://www.aspnetboilerplate.com/Templates 网站下载ABP模版 2.解压后打开解决方案,解决方案目录: ...
- ABP(ASP.NET Boilerplate Project)学习总结
ABP(ASP.NET Boilerplate Project),现下比较流行的一种web框架,因为公司新项目准备使用这种框架,所以写下这篇文章记录下自己一步一步搭建的过程,就当做是对学习的一个总结与 ...
- ABP之什么是ABP(ASP.NET Boilerplate)
1.介绍 ABP是开源的且文档比较齐全的应用程序框架.其实它不仅仅是个框架,考虑其最佳实践,ABP更提供了基于领域驱动设计(DDD)的强大价格模型. ABP支持最新的ASP.NET Core和EF C ...
随机推荐
- 【工业串口和网络软件通讯平台(SuperIO)教程】七.二次开发服务驱动
SuperIO相关资料下载:http://pan.baidu.com/s/1pJ7lZWf 1.1 服务接口的作用 围绕着设备驱动模块采集的数据,根据需求提供多种应用服务,例如:数据上传服务.数 ...
- 转移博客到xinqiyang.freeflare.com了,这里会继续更新.
hi.... 欢迎大家来到这里,这里将转移到github page搭建的博客 http://xinqiyang.freeflare.com 了,现在习惯于实用markdown来写东西了,这样可以脱离浏 ...
- 【grunt整合版】30分钟学会使用grunt打包前端代码
grunt 是一套前端自动化工具,一个基于nodeJs的命令行工具,一般用于:① 压缩文件② 合并文件③ 简单语法检查 对于其他用法,我还不太清楚,我们这里简单介绍下grunt的压缩.合并文件,初学, ...
- 码农干货系列【20】--add gtTime to Promise.js
使用场景 在一些时候,希望一件task不能太快完成,需要大于多少时间才可以执行,就可以使用Promise的gtTime方法. 使用方式 Promise.gtTime(f1(), 5000).then( ...
- jQuery siteslider 动画幻灯片
在线实例 效果一 效果二 使用方法 <div class="container demo-1"> <div id="slider ...
- 天津政府应急系统之GIS一张图(arcgis api for flex)讲解(二)鹰眼模块
讲解GIS功能模块实现之前,先大概说一下flexviewer的核心配置文件config.xml,系统额GIS功能widget菜单布局.系统的样式.地图资源等等都是在这里配置的,这里对flexviewe ...
- linux文件目录详解
文件系统的是用来组织和排列文件存取的,所以她是可见的,在Linux中,我们可以通过ls等工具来查看其结构,在Linux系统中,我们见到 的都是树形结构:比如操作系统安装在一个文件系统中,他表现为由/起 ...
- 一个有趣的CM
系统 : Windows xp 程序 : Crackme#3 - Self Destructed 程序下载地址 :http://pan.baidu.com/s/1kVxwlaZ 要求 : 注册机编写 ...
- Android系统的五种数据存储形式(二)
之前介绍了Android系统下三种数据存储形式,今天补充介绍另外两种,分别是内容提供者和网络存储.有些人可能认为内存提供者和网络存储更偏向于对数据的操作而不是数据的存储,但这两种方式确实与数据有关,所 ...
- 《ARC以及非ARC的讨论》
ARC的机制是什么?它在那里放入retain/release函数调用? 请停止思考这些问题,把更多的精力放在下面的问题上,比如你的程序逻辑,对象的强,弱引用,对象的所属关系,可能的循环引用等问题上. ...