dto

How to use Dozer with Spring Boot?

拈花ヽ惹草 提交于 2019-11-30 12:06:49
I am working on a Spring Boot project. I just have annotation configuration. I want to include dozer to transform Entities to DTO and DTO to Entities. I see in the dozer website, they explain i have to add the following configuration in spring xml configuration file. Since i have not xml file but annotation configuration Java class, i don't know how to translate this into Java Configuration class. <bean id="org.dozer.Mapper" class="org.dozer.DozerBeanMapper"> <property name="mappingFiles"> <list> <value>dozer-global-configuration.xml</value> <value>dozer-bean-mappings.xml</value> <value>more

Breeze.js mixing DTOs and entities

泄露秘密 提交于 2019-11-30 10:12:18
In Ward's article " The Breeze Server: Have It Your Way ": The typical business application has a minimum of 200 domain model types. 90+% of the time the shape of the data I'm sending over the wire is the same as the shape of the entity in my business model. ... When the shape of a client entity doesn't align well with the shape of a server-side business entity, I may switch to a DTO for that particular case. This hits the nail right on the head for our application, but what's the best way to switch just some entities for DTOs? For example, our User entity contains sensitive properties that

Domain Entities, DTO, and View Models

可紊 提交于 2019-11-30 04:56:26
I have an ASP.NET MVC 2 application with a POCO domain model and an NHibernate repository layer. My domain model has no awareness of my viewmodels so I use automapper to go from viewmodel to entity and vice/versa. When I introduced WCF to my project (a late requirement), I started having to deal with disconnected objects. That is, I retrieve an entity from the database with NHibernate and once that entity is serialized it becomes disconnected and each child collection is loaded regardless of whether or not I plan on using it meaning I'm doing alot of unnecessary database work. After reading up

BES-项目中PageHelper的使用

大兔子大兔子 提交于 2019-11-30 04:38:00
项目中为了减少数据传输并在前段实现分页功能,使用了PageHelper。用PageInfo来返回值。 以Organization表操作为例。 Controller层 controller子项目中的application.yml中对pagehelper的配置: pagehelper: helperDialect: mysql reasonable: true supportMethodsArguments: true params: count=countSql Controller层仅仅是用PageInfo<VO>重新包装了service层返回的数据。 @PostMapping(value = "/queryByCondition") public CommonResponse<PageInfo<OrganizationDataListVO>> queryByCondition(@RequestBody CommonRequest<OrganizationQueryConditionVO> commonRequest){ CommonRequestUtils.checkCommonRequest(commonRequest); OrganizationDTO dto = new OrganizationDTO(); OrganizationQueryConditionVO

EF with POCO + WCF + WPF. Reuse POCO classes on client or use DTOs?

梦想与她 提交于 2019-11-29 23:12:59
问题 We are developing a 3-tier application with a WPF client, which communicates through WCF with the BLL. We use EF to access our database. We have been using the default EntityObject code generator of EF, but had lots of problems and serialization issues when sending those object through the wire, and when processing and reattaching them in the BLL. We are about to switch to the POCO template, and rewrite the data access and the communication parts of our app (we are hoping to have a cleaner

FreeSql (二十一)Dto 映射查询

梦想的初衷 提交于 2019-11-29 20:41:29
Select<Tag>().Limit(10).ToList(a => new TestDto { id = a.Id, name = a.Title }); Select<Tag>().Limit(10).ToList(a => new TestDto()); Select<Tag>().Limit(10).ToList(a => new TestDto { }); Select<Tag>().Limit(10).ToList(a => new TestDto() { }); Select<Tag>().Limit(10).ToList<TestDto>(); 这种映射支持单表/多表。 查找规则,查找属性名,会循环内部对象 _tables(join 查询后会增长),以 主表优先查,直到查到相同的字段。 如: A, B, C 都有 id,Dto { id, a1, a2, b1, b2 },A.id 被映射。也可以指定 id = C.id 映射。 友情提醒:在 dto 可以直接映射一个导航属性 来源: https://www.cnblogs.com/FreeSql/p/11531376.html

Using DTO to transfer data between service layer and UI layer

感情迁移 提交于 2019-11-29 20:31:12
I've been trying to figure this out for days but there seems to be very little info on this particular subject with ASP.NET MVC. I've been Googling around for days and haven't really been able to figure anything out about this particular issue. I've got a 3 layer project. Business, DAL and UI/Web layer. In the DAL is dbcontext, repository and unit of work. In the business layer is a domain layer with all the interfaces and the EF models. In the business layer there is also a service layer with DTOs for the EF models and a generic repository service that accesses the repository. This picture

abp(net core)+easyui+efcore实现仓储管理系统——使用 WEBAPI实现CURD (十二)

浪子不回头ぞ 提交于 2019-11-29 20:19:47
abp(net core)+easyui+efcore实现仓储管理系统目录 abp(net core)+easyui+efcore实现仓储管理系统——ABP总体介绍(一) abp(net core)+easyui+efcore实现仓储管理系统——解决方案介绍(二) abp(net core)+easyui+efcore实现仓储管理系统——领域层创建实体(三) abp(net core)+easyui+efcore实现仓储管理系统——定义仓储并实现 (四) abp(net core)+easyui+efcore实现仓储管理系统——创建应用服务(五) abp(net core)+easyui+efcore实现仓储管理系统——展现层实现增删改查之控制器(六) abp(net core)+easyui+efcore实现仓储管理系统——展现层实现增删改查之列表视图(七) abp(net core)+easyui+efcore实现仓储管理系统——展现层实现增删改查之增删改视图(八) abp(net core)+easyui+efcore实现仓储管理系统——展现层实现增删改查之菜单与测试(九) abp(net core)+easyui+efcore实现仓储管理系统——使用 WEBAPI实现CURD (十一) 上接( abp(net core)+easyui+efcore实现仓储管理系统——使用

Domain vs DTO vs ViewModel - How and When to use them?

牧云@^-^@ 提交于 2019-11-29 20:19:24
In a Multi-layer project with Domain layer (DL)/Business (Service) Layer (BL)/Presentation Layer (PL), what is the best approach to deliver Entities to the Presentation Layer? DO => Domain Object; DTO = Domain Transfer Object; VM => View Model; V => View; Option 1: DL => DO => BL => DTO => PL => VM => V This option seems to be the Best Practice but also seems heavy to mantain. Option 2: DL => DO => BL => DTO => PL => V This option seems not very good practice but as DTO are almost identical to the VM, we can pass it directly to the View and it's less painfull to implement and mantain. Is this

Should I map a DTO to/from a domain entity on both client and server sides?

泪湿孤枕 提交于 2019-11-29 19:55:19
I've got a rich domain model, where most classes have some behaviour and some properties that are either calculated or expose the properties of member objects (which is to say that the values of these properties are never persisted). My client speaks to the server only via WCF. As such, for each domain entity, I have a corresponding DTO -- a simple representation that contains only data -- as well as a mapper class that implements DtoMapper<DTO,Entity> and can convert an entity to its DTO equivalent or vice-versa through a static gateway: var employee = Map<Employee>.from_dto<EmployeeDto>();