Extending WCF DataContract just to use it in GUI layer?

Is this valid? or does it smell? What I'd want to do is:

  • Have a datacontract object that holds a friendly object tree that can be saved by the service layer without the GUI not having to worry about it.
  • At the GUI level I make heavy use of databinding and also have some GUI specific logic (like cloning, flagging as deleted, basic validations, INotifyPropertyChanged etc).

I'd like to extend this DataContract class so I just have to add BindingLists, or my specific GUI logic and then send this object without the need of translating it to the WCF service layer.

Maybe composition is a better approach than extending? any ideas?

Answers


I wouldn't extend the DataContract class. I would create a Facade that added the extra functionality that I needed and could also handle communicating back down through the DataContract transparently.


Need Your Help

Disconnect and later reconnect a Qt signal

c++ qt signals-slots qt-signals

Is there a way to disconnect a Qt signal only temporarily, but store a list of the objects connected to it, so the signal can later be reconnected to them?

How to pass multiple params in a text_field_tag

ruby-on-rails ruby ruby-on-rails-3

Ok, so i am trying to get the value from one textfield and pass it to two different methods in a viewController when the user clicks on either the "Add" button or "search" button (so if user presses

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.