dto

With NHibernate, how can I create an INHibernateProxy?

After lots of reading about serialization, I've decided to try to create DTOs. After more reading, I decided to use AutoMapper. What I would like to do is transform the parent (easy enough) and transform the entity properties if they've been initialized, which I've done with ValueResolvers like below (I may try to make it generic once I...

Is it good practice to have DTO objects deepy integrated in code?

I'm building a fairly large application that makes use of the DAO/DTO design pattern to obtain data from a database. In the application a particular DTO has become the "core data structure" in that it's referenced all throughout the project. I'm wondering if it is a good practice to have this DTO so deeply integrated throughout the proje...

Update entity therough DTO

Hello guys. I've got common scenario: SL app and wcf service as data source. I use dtos for transport business objects over the wire. I get issue - Update entity. At client form I have binded dto and send to wcf. I want to know nice way update real db entity by dto data. At wcf I use Nhibernate DAL. My way is getting attached entity by i...

Best way to handle light weight (skeletal) representation in web service XML schema?

I'm new to the whole web service space, so pardon the question if it seems stupid or obvious! I have a number of entities that can be provided by a new web service that I am creating. Some of these entities are composed of very large graphs of objects. However, at times the client will want to search for some of these entities and...

How do I use AutoMapper to populate back to a DataTable?

I'm using AutoMapper which is a great tool. There's lots of examples converting from DataTable/IDataRead to DTO's but I can't seem to find any that convert the DTO back to a DataTable. Is this possible? I've tried various things, but I think there's some difficulty with the creation of Rows - as you can't new them up. ...

Sharing content between business objects and DTOs

All, My typical approach for a medium sized WCF service would be something like: Define the interface using WCF data contracts and service operations. The data contracts would be POCO DTOs with no CRUD or domain logic. Model the domain using fully featured business objects. Provide some mechanism to go from DTO to BO and vice versa (...

BindingList for DTO which support object deleted state

I have a BindingList for DTO which can bind directly to window form control and the problem was raised when user want to delete a row in my datagridview. In that situation, the deleted object (row) go away and when that DTO BindingList get back to server for updating, I dont know which row to delete. Can a BindingList have a collecti...

table data gateway and data access object architectural difference

Hi, Can someone describe the main difference between table data gateway (TDG) and data access object (DAO) ? TDG can operate with all row for that table but so and DAO (DAO can save, delete the specified object, but also can do operations on entire table) Regards ...

Pattern for client-side update in SOA

I want to develop a data-driven WPF application, which uses WCF to connect to the server-side, which itself uses NHibernate to persist data. For examle there is a domain-object called "Customer" and there is also a flattened (with Automapper) "CustomerDTO" which is returned by a WCF-operation called "GetCustomer(int customerId)". I don'...

Is this 'layering' of my web-service correct? Can it be improved?

I am writing a Web Service to retrieve Invoice information from a database table. The specifics are as follows: I intend to give InvoiceAgentId as input and retrieve PayerId,PayerName, EffDate and InvoiceAgentId. Now, 1. In the InvoiceInfoSearch.asmx.cs file I have the WebMethod ... GetInvoiceInfo 2. I have the DTO objects InvoiceInfoReq...

Use same DTO library on client and server with asp.net webservices

Hello I have a (silverlight) class library containing plain DTO classes. For this example "Person". I have a ASP.NET Webservice (.asmx) that returns a List of Person. Now on the consuming side (silverlight) I want to generate a client stub for the webservice. This works ok, however, it generates a NEW Person class for me.. I want to r...

Passing DTOs around in the domain model

I see DTO types being created within and passed between types in the domain model. Is this good practise? I always thought DTOs were to be used principally at context boundaries (i.e. at the edge of the object graph) to decouple context implementations (e.g. at the domain / ui boundary). ...

ruby on Rails dto objects - Where do you store them?

Does anyone here use DTO's to transfer data from the controller to the view? If so, where would you recommend storing those files? /apps/dtos, and then let them mirror the views dir structure? Any recommendations on testing these animals with rspec? ...

Query Object without magic strings

Ok, I have a question. I have 3-tier project. Dal => Domain => UI. design choice is not to expose domain objects (business classes) to the ui, but to use DTO. I am trying to build a Query engine that takes parameters from the ui layer and converts into the NHibernate criteria api on the dal layer. The point is the ui layer does not known...

WCF data object receive progress

Hi, I'm looking for a way to retrieve a collection of DTOs from my WCF data service in a way that will allow me to be informed every time a whole DTO from the collection has finished downloading, also I want to be able to read it of course. Means, if I want to get a collection of users, every time a user from the collection is download...

How large should be Data Transfer Objects?

As I understand, Data Transfer Objects are used for different purposes, so let's bound the scope with the view layer in Java (JSF) -based web-applications (i.e. there are usually some entity-objects mapped on a DB, which can be also used in a Business-Logic layer, and some transfer objects used in a presentation layer). So, I have some...

What is the proper way of using DTOs in this case?

I have the following domain class: public class Product { public virtual Guid Id { get; set; } public virtual string Name { get; set; } public virtual IList<Product> RelatedProducts { get; set; } } I have the following DTO class: public class ProductDTO { public ProductDTO(Product product) { Id = product.I...

Dynamic DTO in .Net?

I have been doing quite a bit of work lately that involves taking stored procedure calls and mapping them to private DTO classes. I was thinking the other day there has to be an easier way. So far this is what i have come up with: CodeSmith - OK solution but it will be a no go where i work. The budget is pretty tight right now. Typed...

JPA and DTO's, best way to create DTO's?

We're to use DTO's to send data to and from the presentation layer. I have a method on a service object called PostAd which posts an advertisement entered by a user. The Ad has an association to another object called AdValues, which contain values for the Ad (title, price, description etc) @Entity public class Ad { @OneToMany Se...

Dto and domain entities. Did I create my dto correctly?

I have the following domain entity: public class CartItem { public virtual Guid Id { get; set; } public virtual Guid SessionId { get; set; } public virtual int Quantity { get; set; } public virtual Product Product { get; set; } } I have the following DTO: public class CartItemDTO { public CartItemDTO(CartItem c...