dto

Is there a way to transfrom a list of key/value pairs into a data transfer object

...apart from the obvious looping through the list and a dirty great case statement! I've turned over a few Linq queries in my head but nothing seems to get anywhere close. Here's the an example DTO if it helps: class ClientCompany { public string Title { get; private set; } public string Forenames { get; private s...

Should business objects be able to create their own DTOs?

Suppose I have the following class: class Camera { public Camera( double exposure, double brightness, double contrast, RegionOfInterest regionOfInterest) { this.exposure = exposure; this.brightness = brightness; this.contrast = contrast; this.regionOfInterest = regi...

Hibernate GenericDAO for parent/child relationships and DAO/DTO patterns

Hi, I'm looking for a Generic DAO implementation in Hibernate that includes parent/child relationship management (adding, removing, getting children, setting parents, etc). Actually the most used generic DAO on the web is the one I found on jboss.org. And also, i was looking for some DAO/DTO sample implementations and design pattern...

MVVM pattern: ViewModel updates after Model server roundtrip

I have stateless services and anemic domain objects on server side. Model between server and client is POCO DTO. The client should become MVVM. The model could be graph of about 100 instances of 20 different classes. The client editor contains diverse tab-pages all of them live-connected to model/viewmodel. My problem is how to propaga...

Returning a DTO vs DataTable from the DAL

Is it fine to have the DAL return a DTO type from the Domain model vs just returning a DataTable? Isn't is looser to have your DAL functions return DataTables/DataSets and have your BLL map the data to business objects? ...

BestPractice: May a DTO have navigation properties?

May a DTO have relations to other DTOs? Any more opinions on this topic :-) ? ...

Best practice for building a composite data transfer object (DTO) with Domain Driven Design (DDD)

I'm trying to figure out the best approach/practice for assembling a composite data transfer object off of an aggregate root and would love to hear people's thoughts on this. For example, lets say I have a root that has a few domain objects as children. I want to assemble a specific view dto, based on some business logic, that either ha...

DTO or Domain Model Object in the View Layer?

I know this is probably an age-old question, but what is the better practice? Using a domain model object throughout all layers of your application, and even binding values directly to them on the JSP (I'm using JSF). Or convert a domain model object into a DTO in the DAO or Service layer and send a lightweight DTO to the presentation ...

Should I use DTOs as my data models in MVVM?

I'm currently working on what will be my first real foray into using MVVM and have been reading various articles on how best to implement it. My current thoughts are to use my data models effectively as data transfer objects, make them serializable and have them exist on both the client and server sides. It seems like a logical step giv...

AutoMapper and SecurityException in IIS

Hi everybody... I'm developing a asp.net mvc application with nhibernate and I would not like to expose my objects mappings with NHibernate, so I created DTO for each entity and I'm trying to convert my Domain objects to DTO and send it to View. So I have in my sollution: ClassLibrary with my Domain (for NHibernate) and DTO objetcs Cla...

Dozer mapping for Hibernate object to DTO

Hello, I try to use Dozer to convert my domain entity to DTO objects. So, I want to convert PersistentList, PersistentBag, ... from my domain entity to ArrayList, ... in my DTO objects to avoid lazy problem. This is an example of two of my domain entity : public class User { private Collection<Role> roles; ... } public cl...

DTO and mapper generation from Domain Objects

I have plenty of java domain objects that I need to transform to DTOs. Please, don't start with the anti-pattern thing, the Domain Objects are what they are because of a long history, and I can't modify them (or not too much, see below). So, of course, we've passed the age of doing all that manually. I've looked around, and dozer seems...

What are the best practices for writing a DTO layer in an enterprise ASP.net application?

Are there any open source alternatives that come with backed in caching etc? ...

How should be my DTO object for ASP.Net MVC View ?

Hi all, i'd like to know, I have a application in asp.net mvc and nhibernate. I've read about that in the Views on asp.net mvc, shouldn't know about the Domain, and it need use a DTO object. So, I'm trying to do this, I found the AutoMapper component and I don't know the correct way to do my DTOS, for some domain objects. I have a domain...

NHibernate. DTO -> Domain

Hello guys. I've got SOA which processing data for diff clients(asp,sl). The base of this design is domains of my business model. For transporting,showing it to clients I use DTO. For mapping domain to DTO I use AutoMapper. Now I should persist new entities from clients. I want use my DTO's at this scenario too. So i've got some questio...

Different types of Id when exposing DTO over WCF

Lets say we have a simple DTO with properties Id, Name. If this DTO comes from database through some data layer, Id should be of type int. If this DTO comes from Active Directory, through some data layer, Id should be of type Guid. What would be the best way to implement this? Thanks in advance! ...

EFv1 mapping 1 to many Relationship to POCOs

I'm trying to work through a problem where I'm mapping EF Entities to POCO which serve as DTO. I have two tables within my database, say Products and Categories. A Product belongs to one category and one category may contain many Products. My EF entities are named efProduct and efCategory. Within each entity there is the proper Navigat...

implement N-Tier Entity Framework 4.0 with DTOs

Hi, I'm currently building a web based system and trying to implement N-Tier Entity Framework 4.0 with DTOs in a SOA Architecture. I am having a problem understanding how I should implement the Data Access Layer (DAL) , the Business Logic Layer (BLL) and the Presentation Layer. Let’s suppose that I have a “useraccount” entity has the ...

Reset application and settings on user change

Currently working on a project where a login will be required to use the application. I'm trying to figure out a smarter way to reset the application if someone is somehow logged out and the next one to login is not the same user. The option I have come up with at the moment is storing all user specific data/information in a DTO but th...

Converting DTOs to View Models

Does anyone know of a good (read: quick to code) method for converting DTOs to View Models or mapping DTO members to View Model members? Lately I've been finding myself writing many conversion and helper methods but this is a very arduous and tedious task. Moreover, it will often needs to be done twice (DTO -> View Model, View Model -> D...