I've got a set of business/domain classes (for a calendar) that are going to be exposed in an internally-public API. In the same API, there are data objects that directly mirror the underlying database structure (NHibernate mapping, but that's unimportant).
What I need to do is build typed collections of those objects, so the days on th...
I am considering bringing NHibernate into a project but have a question on how read only DTOs would be implemented. Entities are easy, but what about scenarios where you have a field our two from multiple entities/tables that need to be mashed together for display data on a view. Surely it would be overkill to load up all of the entities...
Have seen some similar questions here and here.
Can you also please tell me the contexts in which they are used?? Or the purpose of them?
...
Trying to map a model class to service dto class where both have a custom class property.
i.e.
class Source
{
public CustomObject MyProperty {get;set;}
}
class Destination
{
public CustomObject MyProperty {get;set;}
}
However at the point of mapping, the Destination is Webservice.Destination, and so CustomObject is also Webservice.De...
I feel this is a stupid question even before asking, but my brain isn't working too well right now. I have two WCF services "CountryService" and "FloristService".
Now CountryService has the following method:
IList<CountryDTO> GetAllCountries();
Additionally, FloristService has a method:
bool AddFlorist(FloristDTO florist);
All go...
I have a DTO that has a whole bunch of members. I was wondering if Java supports the idea of a for(in) for the class. I don't think it does, but it would save me a ton of grief if it did, so, I figured I'd toss the question out there.
...
Hi,
When creating an n-tier solution, I don't want to expose my business objects, but use DTO's instead of this. On the other side, I don't want to doubly define objects and write copy-code all the time.
Now my idea would be to write DTOs that contain all necessary fields and properties, but no logic (only state).
Then I would derive ...
I'm curious to know what the community feels on this subject. I've recently come into the question with a NHibernate/WCF scenario(entities persisted at the service layer) and realized I may be going the wrong direction here.
My question is plainly, when using a persistent object graph(NHibernate, LINQ to SQL, etc) behind a web service(W...
There was a very interesting discussion on LosTechies regarding AutoMapper(an argument for/against 2-way mapping).
This actually caught my attention due to the problem I'm currently working through. I'm working on a shipment piece to provide information such as rates/delivery times to my users. To centralize the actual services, I have ...
Hi,
i'm building a DAL in C# that is connecting to an ancient versione of informix, so i cannot use entity framework. I wrote the entities classes referencing them self in a parent-child fashion. now i wrote the DAL classes one for each entities implementing generic methods such as getbyid(object key),findall() ... now the question is f...
I would like to use the DataAnnotations on my transfer objects. However how do I call them in the business layer to verify the input?
Is this by some method call or reflection?
I do not use ASP.NET but standard ASP.NET and would like to call the data annotations in the business layer.
...
I have an application with a repository layer (and a nhibernate implementation), service (bussiness) layer, and an asp.net mvc in the web layer.
Because I also need to create a small silverlight application I will create several wcf services. This calls to use DTO's, but I don't know how & where to create them.
I've seen some links (li...
Hello,
I am designing a web application in c# that mostly talks with the database. I have created a DTO for each table in the database. Now for each Table there is a custom table repository class that does all the saving and fetching pertaining to that particular table, and I'm using stored procedures for that.
The issue is now some sto...
I am trying to figure out an easy way to map DTOs to entities without the boiler-plate code. While I was thinking of using dozer it appears to require a lot of xml configuration. Has anybody seen a dozer alternative that uses a DSL to configure the bean mapping in pure Java?
Ideally I am hoping to find a bean mapper that is inspired b...
see also Hows to quick check if data
transfer two objects have equal
properties in C#?
I have lot of Data Transfer Objects (DTO) that each contains lots of simple fields. I need to implement Equals on all of them (so I can write some unit tests off transporting them var WCF).
The code I am using is:
public override bool Equal...
I am trying to get my head around business entities that you want to list in a grid or list where a user will pick one to edit/view.
Lets say I have an Entity that have a lot of properties and collections, but my Grid will only display like 2 properties to the user. Besides using lazy loading on collections what would be the best / effi...
When a controller detects that a DTO passed to it is null should it instantiate an instance of the DTO (cf the Null Object Pattern), or should it simply throw an exception there and then?
Thanks
...
We have an entity (class) containing data and methods (lets call it Person). There are other classes that need to use the data in this object (let's call one of them Accountant), but do not need to use the functionality in it's methods.
Would it be better to send the entire Person object to Accountant, or to create a new PersonData o...
I'm using NHibernate to persist my domain objects.
To keep things simple I'm using an ASP.NET MVC project as both my presentation layer, and my service layer.
I want to return my domain objects in XML from my controller classes. After reading some posts here on StackOverflow I gather DTOs are the way to go. However, I've also come acros...
Well guys, as described above I'm implementing a multi-tier architeture to work with WCF and Entity Framework 4 (with poco). Since I'm already have persistence ignorance with POCO I do need implement DTO or I can use WCF in its pure way.
The main quote is - I do need DTO to pass a lightwheight object in the network or I can use my POCO e...