How to convert a DTO to domain objects

I'm trying to apply ubiquitous language to my domain objects. I want to convert a Data Transfer Object coming from a client into the domain object. The Aggregate's Constructor only accepts the required fields, and the rest of parameters should be pas

Skip json with multi-type lists to the web API

I want to be able to pass object with multi-type list to web api call, but it seems that if I don't explicitly state properties, web api just ignores the data. Below you can see, that an Interface is used as placeholder to allow multi-type lists in C

Avoid N + 1 with DTO mapping on Hibernate entities

In our Restful application we decided to use DTO's to shield the Hibernate domain model for several reasons. We map Hibernate entities to DTO and vice versa manually using DTOMappers in the Service Layer. Example in Service Layer: @Transactional(read

Best Practice - Multilayer Architecture and DTO

After reading some of the Q/As here on stackoverflow, I am still confused about the correct implementation of DTOs in my web application. My current implementation is a (Java EE based) multi-tier architecture (with persistence, service and presentati

Process code duplication in tests

At work I practice Test Driven Development as much as possible. One thing I often end up in though is having to set up a bunch of DTO's and when these have a slightly complex structure this becomes quite alot of code. The problem with this is that th

Entity Framework can not save my change

I'm using the following design: I'm using AutoMapper for the domain/DTO conversions (both ways), Entity Framework Code First, and SQL Server 2012. Each table has a field named RowVersion of type timestamp in order to check updates. I'm using a DTO la

Merge data from two DAO into one TO

I have a siutation where I want to work with one business object (TO). However the data that this TO consist of comes from 2 different data sources: The application's database, which will be accessed through JPA and one Entity An old system's data, w

Creation of JPA from the base

I know this is a duplicate question. But even i couldn't find any tool to create JPA entity file from database source. I used eclipse to do this. I only got DTO kind of classes with getters & setters. Can anyone suggest some tools that create DAO fil

Create a list with database values ​​and store in DTO

I have a my main class, a DTO, and a DAO. what I want to do is to read the database table CUSTOMER(two fields NAME, SURNAME) then write it to a txt file. I cant seem to get it to store the values in the DTO so that my main class can get it. My DTO ex

NHibernate DTO with a deep object graphic

I am writing a smart client WPF application using MVVM that communicates with a WCF service layer containing the business logic and domain objects that uses NHibernate to manage persistence. We are in control of both sides of the wire. Currently, I a

GWT RPC: DTO vs. DAO?

I've started learning GWT about a week ago and here's the question I can't answer for sure. Here's the server-side: // business object - has logic interface Article { String getTitle(); // lazy void setTitle(); String getText(); // lazy void setText(

Enum naming conventions in DTO

I'm creating an application facade in front of my domain model and using dto's for the exchanges between the consumer and the facade. In order to avoid having to fully qualify my namespaces where I'm mapping between dto's and the domain model, I've s

How to use DTO in JSF + Spring + Hibernate

Assuming that i'm new about the topic DTO. I can't understand if it is correct to use the DTO in tandem with JSF, Spring and Hibernate. Let me explain, so far I have used the entity bean, created directly from the database, both in business layer and

Framework to convert Java objects

I am working on project that converts database entities into DTO objects. To do it a special converter class is used for each convertion. I am providing simplified example of the things we are doing. I intentionally missed setters/getters and some ot

Polymorphism with AutoMapper

I have these business classes: class BaseNode { public string name; } class CompositeNode : BaseNode { public List<BaseNode> childs = new List<BaseNode>(); } And this flat dto: class NodeDto { public string name; public List<NodeDto> chi

Mapping a partially completed DTO to a domain object

I'm using DTOs between my business and presentation layers and have some mapping code in the service that converts DTO <-> domain object. I'm currently allowing the PL to partially populate a DTO and send it to an Update service, which updates only

Does JAX-RS require data transfer objects (DTOs)?

If a method of a JAX-RS application would return a domain object, the representation (say JSON) would contain all attributes of this object - right? But what if this object would contain "private" data, that shouldn't be exposed to the web? And

Entity Update Strategy

There is some discussion on my team about updating entity data and how best to approach it. This is a security framework and so here are some of the constraints and ideas. every table in DB has a PK that is a guid, this is required for our multi-node

C # DTO and LINQ2SQL

This is my first question, be gentle :). Im working on a project with some kind of distributed architecture.Im trying to do the following: I have a Data Access Layer that uses LINQ2SQL I have a Service Layer that is a proxy for the Data Access Layer.