Recently I decided to start developing a client/service based system using WCF and a Duplex Channel (callbacks from Service to client). The clients will behave as "slaves", that is, they will only connect to server and from then on, only the server communicates with them. Eventually the server may request that the clients send "data streams" to him (frequent updates of new content/objects).

I want to make my software as loosely coupled as possible, but even reading about the different patterns for this, such as MVC and MVP, they don't seem to be designed to fulfill my specific requirements.

What is the best code architecture or pattern for my problem? Considering the technologies I am using?

closed as too broad by gnat, user40980, Kilian Foth, jwenting, GlenH7 Aug 18 '14 at 20:22

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • I think your requirement 'server requests data from clients' is not clear. It could be an ASR (Architecture Significant Requirement). Why, how often? Are client processes long running processes which collects data and stores on client side? And server, whenever he wants, collects them? Are we talking about Web or LAN? – Kaan Aug 16 '14 at 14:27
  • We are talking about lan. Yes the server is going to get data from the clients whenever it wants. – Bruno Klein Aug 16 '14 at 14:52
  • If you collect data from many clients, you need to concentrate on distribution and orchestration. Regardless of what enterprise pattern you choose (MVC, MVVM, MVP, Data-Centric ...), you need to choose also a distribution pattern. (Broker, Coordinator, Orchestration, ... ) – Kaan Aug 16 '14 at 19:10

Patterns Abstract Details, not Vice Versa

The clients will behave as "slaves", that is, they will only connect to server and from then on, only the server communicates with them. Eventually the server may request that the clients send "data streams ... MVC and MVP, ... don't seem to be designed to fulfill my specific requirements."

I'm getting the feeling that you are trying to find a pattern that maps directly to your hardware/network setup. This is the antithesis of Object Oriented design patterns.

Software Systems are Organic Molecules of Patterns

As in chains of patterns. The high-level parts of M.V.P. are in turn their own complex Object Oriented structures as needed to represent nested abstract layers eventually getting to the servers. You're missing all the design between the top layer MVC concept and the server - server communication.


Perhaps you should take a prototype mindset. As Fred Brooks said in the Mythical Man Month

“The management question, therefore, is not whether to build a pilot system and throw it away. You will do that. The only question is whether to plan in advance to build a throwaway, or to promise to deliver the throwaway to customers.”

I'm not suggesting you build an entire system; just enough to experiment with the architecture variations. You really need to understand where you're going with this before you commit to delivery schedules.

As far as Ive been able tell MVP vs MVC is a matter of emphasis. MVP has a more intimate association between the V-and-C.

Following is a quote from MVP: Model-View-Presenter The Taligent Programming Model for C++ and Java

...normalize the separation between the Model and the View-Controller, which we refer to as a Presentation. This represents the breaking down of a programming problem into two fundamental concepts: Data Management and User Interface.

I think it boils down to how one wants to model things. If MVC works in a given case does not mean MVP is wrong for that case.

Software design patterns are guidelines, not hard and fast literal rules to be followed to the exclusion of good design throughout your system.

MVC (MVP) and WCF Systhesis

MVC/P has become the go-to design paradigm for GUI applications so I would not get sidetracked because WCF based on Service Oriented Architecture (SOA).

As far as I can tell one can easily use the WCF .net framework within the Model-View-Whatever pattern.

Not the answer you're looking for? Browse other questions tagged or ask your own question.