dto

Constructing a Domain Object from multiple DTOs

Suppose you have the canonical Customer domain object. You have three different screens on which Customer is displayed: External Admin, Internal Admin, and Update Account. Suppose further that each screen displays only a subset of all of the data contained in the Customer object. The problem is: when the UI passes data back from each ...

How to architect DAL for WebService exposure?

We have a highly specialized DAL which sits over our DB. Our apps need to use this DAL to correctly operate against this DB. The generated DAL (which sits on some custom base classes) has various 'Rec' classes (Table1Rec, Table2Rec) each of which represents the record structure of a given table. Here is a sample Pseudo-class... Public...

Which one do you prefer for Searching/Reporting DataTable or DTO or Domain Class?

The project currently I am working of requires a lot of searhing/filtering pages. For example I have a comlex search page to get Issues by data,category,unit,... Issue Domain Class is complex and contains lots of value object and child object. .I am wondering how people dealing with Searching/Filtering/Reporting for UI. As I know I hav...

What Project Layer Should Screen DTO's Live In?

I have a project where we use screen DTO's to encapsulate the data between the Service Layer and the Presentation Layer. In our case, the presentation layer is ASP.Net. The only classes that know about the DTO's are the service layer classes and the Pages/Controls that call these services and display the DTO's. The DTO's are almost alw...

How to effectively use DTO objects (Data Transfer Objects)?

What is the best way to implement DTOs? My understanding is that they are one way to transfer data between objects. For example, in an ASP.Net app, you might use a DTO to send data from the code-behind to the business logic layer component. What about other options, like just sending the data as method parameters? (Would this be easi...

How to Design Data Transfer Objects in Business Logic Layer

DTO I'm building a Web application I would like to scale to many users. Also, I need to expose functionality to trusted third parties via Web Services. I'm using LLBLGen to generate the data access layer (using SQL Server 2008). The goal is to build a business logic layer that shields the Web App from the details of DAL and, of course,...

Linq to SQL DTOs and composite objects

I am using a similar approach to others in keeping my LINQ objects in my LINQ data provider and returning an IQueryable to allow filtering etc. This works fine for filtering a simple object by it's ID or other property, but I am having a problem with a join table object that is composed of other child objects //CoreDBDataContext db...

Best approach to separate and re-factor a large number of dependent classes

I have a v-large number of hierarchical structures (or DTO's) that are shared across different business logic, application tiers, web service and WCF contracts. I want to refactor all of my code to split the structures into discreet business domain areas. Two questions: Are there any tools that can help me do this (given that I want c...

nHibernate (w/ Castle ActiveRecord) with C# interfaces (esp for DTO's)

Any using nHibernate with a Domain object & DTO object implemented from a common interface? I'm trying to separate all of my nHibernate attributes into the Domain object, leaving my DTO's and interface clean. The problem comes with nHibernate throwing errors when it tries to associate the interfaces with the concrete classes. NHibernat...

C# DTO AND LINQ2SQL

Hi everyboy! 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. I have a Business Layer that calls the Service Layer for Entities. The ...

Best Practices For Mapping DTO to Domain Object?

I've seen a lot of questions related to mapping DTOs to Domain Objects, but I didn't feel they answered my question. I've used many methods before and have my own opinions but I'm looking for something a little more concrete. The Situation: We have many domain objects. We are using a CSLA model so our domain objects can be pretty co...

Calling a getter without assigning it to anything (lazy loading)

I have a DTO which can be fully loaded or lazy loaded using Lazy Load Pattern. How it is loaded depends on what the Flex Application needs. However, this DTO will be sent to a Flex application (swf). Normally, a collection for instance, will only be loaded when called. In my case however, the collection will only be called in Flex, so my...

POCO vs DTO

POCO = Plain Old CLR (or better: Class) Object DTO = Data Transfer Object In this post there is a difference, but frankly most of the blogs I read describe POCO in the way DTO is defined: DTOs are simple data containers used for moving data between the layers of an application. Are POCO and DTO the same thing? (ps: look at this great...

Data Transfer Objects and transactional service methods

Is there any truly practical way to avoid using DTOs, when passing data through Hibernate-backed transactional service methods? In other words, are DTOs the only non-hacky solution to avoiding lazy initialization problems? I think the two popular alternatives to DTOs and the reasons I don't really like them are: Open Session in View p...

Typed Dataset along with Dtos

I have a web application that connects to WCF services for its business logic. I would like to use simple Dto's for transfering data at the WCF boundary for performance and interoperability reasons. However I have to use typed datasets for data access (ORM or any other option is not available due to political reasons). Is it a good ide...

NHibernate Projection to DTO

Hello, I am unfamiliar with NHibernate projection. I am attempting to use it so I can return a List<> rather that an IList<>. I am not having much luck with projecting to the DTO as of yet. I have the following query and Domain objects. So to begin I am just trying to get a list of Orders given an EmployeeID. I am looping through the re...

POCO vs DTO: Is it ok to partially hydrate a domain object?

Its often a requirement to have a domain object displayed in various ways on the UI; lists, search results, view and edit pages, as well as in headers, footers and popups. Typically you have several different "views" of the domain object, each with different fields displayed. Most advice seems to be to use a DTO to get the data when you...

Should SDO (Service Data Object) be adopted in new project ?

I've been programming in Delphi with Midas/DataSnap for quite long time and quite happy with it. Moving to .NET I'm more than happy with the ADO.NET DataSet. For CRUD application, I'm highly uncomfortable with any kind of ORM. Generic data-structure with automatic diff/delta handling get my job done better for me, an average database a...

good way to represent a excel sheet value in Java

Consider that I've a excel sheet in below format: person age Foo 29 Bar 27 Now I want to read these values (using POI HSSF) and have to process them. What's the best way to do that? Note that I do not have a Object Person in my application, becasue the values that may come in excel sheet is arbitrary (i.e. it may not be the ...

NHibernate, DTOs and NonUniqueObjectException

Hi, We're using the DTO pattern to marshal our domain objects from the service layer into our repository, and then down to the database via NHibernate. I've run into an issue whereby I pull a DTO out of the repository (e.g. CustomerDTO) and then convert it into the domain object (Customer) in my service layer. I then try and save a new...