dto

How to use Dozer with Spring Boot?

大城市里の小女人 提交于 2019-11-29 17:57:46
问题 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">

Copying NHibernate POCO to DTO without triggering lazy load or eager load

空扰寡人 提交于 2019-11-29 14:59:13
I need to create DTOs from NHibernate POCO objects. The problem is that the POCO objects contain dynamic proxies , which should not be copied to the DTO. I eager load all the collections and references I need to transfer in advance, I don't want NHibernate to start loading referenced collections which I did not load in advance. Several similar questions on SO received answers which either: Suggest Session.GetSessionImplementation().PersistenceContext.Unproxy(); Suggest turning off Lazy Loading. In my case the first suggestion is irrelevant, as according to my understanding it causes eager

Reusing DTO for various request/response types vs explicitness of what is required / what should be returned [closed]

谁说胖子不能爱 提交于 2019-11-29 06:49:12
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 2 years ago . I started wondering on whether I am not falling into an antipattern here, so please advise on the best practices. I am designing a REST API with a set of various endpoints and I wanted to wrap the request & response parameters into nice DTO. For example, a few endpoints:

What format (MIME Type) should I use for HTML5 drag and drop operations?

二次信任 提交于 2019-11-29 06:40:15
问题 I'm starting to experiment with HTML5 Drag and Drop. Then, in the dragstart event handler we should run setData() , which receives two parameters: format and data . function dragstart_handler(ev) { ev.dataTransfer.setData('text/plain', 'foobar'); } I want to drag some kind of "object" from one container into another container, inside my web application. By "object", I mean something that has multiple attributes (color, text, author, date, …). What kind of format (or MIME Type) should I use?

Domain Entities, DTO, and View Models

孤街浪徒 提交于 2019-11-29 02:27:14
问题 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

Json A circular reference was detected while serializing an object of type

岁酱吖の 提交于 2019-11-29 01:10:39
Give the classes: public class Parent { public int id {get; set;} public int name {get; set;} public virtual ICollection<Child> children {get; set;} } [Table("Child")] public partial class Child { [Key] public int id {get; set;} public string name { get; set; } [NotMapped] public string nickName { get; set; } } And the controller code: List<Parent> parents = parentRepository.Get(); return Json(parents); It works on LOCALHOST, but it does not work on live server: ERROR : Json A circular reference was detected while serializing an object of type I did a search and found the [ScriptIgnore]

DTO Pattern + Lazy Loading + Entity Framework + ASP.Net MVC + Auto Mapper

泄露秘密 提交于 2019-11-28 23:06:32
问题 Firstly, Sorry For lengthy question but I have to give some underlying information. We are creating an Application which uses ASP.net MVC, JQuery Templates, Entity Framework, WCF and we used POCO as our domain layer. In our application, there is a WCF Services Layer to exchange data with ASP.net MVC application and it uses Data Transfer Objects (DTOs) from WCF to MVC. Furthermore, the application uses Lazy Loading in Entity Framework by using AutoMapper when converting Domain-TO-DTOs in our

Tracking changes in complex object graph

橙三吉。 提交于 2019-11-28 20:51:16
I started to think about tracking changes in complex object graph in disconnected application. I have already found several solutions but I would like to know if there is any best practice or what solution do you use and why? I passed same question to MSDN forum but I received only single answer. I would like to have more answers to learn from experience of other developers. This question is related to .NET so for answers with implementation details I prefer answers related to .NET world but I think this is the same on other platforms. The theoretical problem in my case is defined in multi

Data transfer object pattern

老子叫甜甜 提交于 2019-11-28 20:43:23
i'm sorry i'm newbie to enterprise application as well as the design pattern. might be this question occcur lack of knowledge about design pattern. i found that its better to use DTO to transfer data. my business entity class as below: public class Patient { public string ID { get; set; } public string FullName { get; set; } public string FirstName { get; set; } public string Surname { get; set; } } so in my application user only give ID and HospitalID. so it calls for another web service and get person information public class PersonDTO { public string NIC { get; set; } public string FullName

领域驱动设计系列(2)浅析VO、DTO、DO、PO的概念、区别和用处

家住魔仙堡 提交于 2019-11-28 19:54:12
领域驱动设计系列(2)浅析VO、DTO、DO、PO的概念、区别和用处 作者: Johnny.Liang 发布时间: 2015-06-02 18:47 阅读: 5612 次 推荐: 13 原文链接 [收藏]    上一篇 文章作为一个引子,说明了领域驱动设计的优势,从本篇文章开始,笔者将会结合自己的实际经验,谈及领域驱动设计的应用。本篇文章主要讨论一下我们经常会用到的一些对象:VO、DTO、DO和PO。   由于不同的项目和开发人员有不同的命名习惯,这里我首先对上述的概念进行一个简单描述,名字只是个标识,我们重点关注其概念:    概念:   VO (View Object ): 视图对象,用于展示层,它的作用是把某个指定页面(或组件)的所有数据封装起来。   DTO (Data Transfer Object ): 数据传输对象,这个概念来源于J2EE的设计模式,原来的目的是为了EJB的分布式应用提供粗粒度的数据实体,以减少分布式调用的次数,从而提高分布式调用的性能和降低网络负载,但在这里,我泛指用于展示层与服务层之间的数据传输对象。   DO (Domain Object ): 领域对象,就是从现实世界中抽象出来的有形或无形的业务实体。   PO (Persistent Object ): 持久化对象,它跟持久层(通常是关系型数据库)的数据结构形成一一对应的映射关系