Class names in Presentation Layer reference

 
50   50
Sep 27, 2010
 
Hi,

I am exploring Patters in Action 4.0 framework.On Product.aspx.cs page there is reference to Product object.
ActionServiceReference.Product product = repository.GetProduct(ProductId);

I cannot find Product class in Service layer, how does it get referenced in Presentation layer. I can find  Product in Business layer and another one in  ASP.net Presentation layer.

Thanks,
Praveen.





800   99.9
Sep 28, 2010
Praveen:

This is a nice WCF feature.  You can decorate your classes in the BO with attributes like [DataMember] and [DataContract] that allow you to specify the names of the generated proxy classes on the client.

Hope this helps.




50   50
Sep 29, 2010
Thanks Dan, So in the above code Product is referring to ProductDto in service layer and not Product in Business Layer.
Snippet  [DataContract(Name = "Product", Namespace = "http://www.yourcompany.com/types/")]     public class ProductDtoAlso as in the example, if Data Access object does not have any methods, do we need separate Dto objects if we move Data Access objects to separate project. I am working on a project where business logic is implemented in service layer implementation, client makes call on Facade and it calls service layer.

Praveen.




800   99.9
Sep 29, 2010
Praveen:

Yes, you are right, the attributes are on the DTOs rather than the BOs.

Also, separating your Facade, Service Layer, Business Layer and Data Access Layer into separate projects is very much a matter of your particular requirements and/or preferences.