Inconsistence in persistence services

Topics: Developer Forum
Oct 5, 2006 at 10:19 PM
the class CustomerPersistenceService.cs in ManagedDesigns.Northwind assembly has the same responsibilities of the types CustomerOperationDto and ICustomerPersistenceService in the assembly ManagedDesigns.Northwind.UI.Presentation .

Am I missing something or this is a duplication?
It's quite strange that this responsibility is located in 2 different namespaces and different assemblies too.

Please help me to understand what's going on and what path should I follow.
Oct 6, 2006 at 8:36 AM
I have the similar question.
Why the CustomerPresenter class use the CustomerOperationDto (for Create and Update Customer) and the CustomersPresenter class used the IUnitOfWork directly (for Delete Customer)?
What's the meaning of "DTO" word in "CustomerOperationDto"?

Apr 23, 2007 at 1:35 PM
I am being also half lost!

DTO = Data Transfer Object

I think IUnitOfWork is used because she can be implemented of different providers of data.

See that IUnitOfwork for each provider type she was implemented differently, it is not like this necessary alterations in the classes of Presentations, etc...

To classes they simply consumed an unit of work, as you implemented her.

Correct if I am wrong, I am new in programming guided to objects.
Oct 3, 2007 at 10:17 AM
I dont want to use UnitOfWork directly from presentation layer.

Ex. in CustomerListPresenter class:

instead of
IUnitOfWork service;

use xxxPersistenceService classes like
CustomerPersistenceService service;

and instead of
if (this.service == null)
this.service = this.CreateUnitOfWork();
IList<Customer> customersList = service.GetAll<Customer>();

maybe is better...
if (this.service == null)
this.service = new CustomerPersistenceService();
IList<Customer> customersList = service.GetAll();

Correct if I am wrong.
Riccardo di Nuzzo