Views: 13.9K
Replies: 3
Archived
|
Class names in Presentation Layer referenceHi,
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. Praveen Surendran, Sep 27, 2010
|
|
Reply 1Praveen:
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. Dan McMillan, Sep 29, 2010
|
|
Reply 2Thanks 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. Praveen Surendran, Sep 29, 2010
|
|
Reply 3Praveen:
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. Dan McMillan, Sep 28, 2010
|