Good design for asynchronous WCF services calls in the middle tier and the data returned in the UI layer

I have a WPF application with a bunch of asynchronous WCF service calls all aligned in code behind, complete with event handlers and everything else that I have to refactor to build and maintain.

I want to share the concerns about maintainability and all other good reasons for doing this, but I'm not sure exactly how to do this. Does anyone have any good ideas on how to do this, or at least some links to put me in the right direction?

My thinking: Create an "infrastructure" layer and refer to services. Move the asynchronous event handlers to this layer. When an update is called, I create my own event with my own EventArgs derived class, which contains the data that the UI will require. I will have a fairly coherent UI connection to the infrastructure layer as it will consume events that I fire after the asynchronous data call completes.

+2


a source to share


1 answer


The most common pattern for designing a WPF application is the Model-View-ViewModel (MVVM). See this article for an introduction to this topic.



0


a source







All Articles