3

I am currently working on a Web Application. One of the objectives is to use the MVP (Model View Presentation) Design Pattern. We would like to use WebSockets to communicate between client and the server.

My question is: Do I have to put the code for WebSocket handling in the Presentation, or would it be better to put it in the Model? Or none of these propositions?

Since WebSockets are about communication I would tend to put it in Presentation but would like to know your opinion.

I know this question is kind of opinion based, but using design pattern and "smelling" when we have to use them is all about opinion and judgement, that is why I would like to ask you this question.

Glorfindel
3,1676 gold badges28 silver badges34 bronze badges
asked Jul 6, 2017 at 14:10
7
  • 1
    Possible duplicate (about MVC, but MVP is alike): softwareengineering.stackexchange.com/q/293288/173647 Commented Jul 6, 2017 at 14:23
  • One of the objectives is to use the MVP (Model View Presentation) Design Pattern. -- Why? Design patterns are not objectives. The problems you're trying to solve with them are. What problems are you trying to solve by using MVP? Commented Jul 6, 2017 at 15:48
  • I knew I should have explain why ... :) It's because my colleague who lead the project know few about design pattern and so do all of my colleagues. I am the only one knowing about it. So my "chief" asked me do some researches to approve or not the use of design pattern ( MVP). This Project has a double objective : Satisfy the client of course and introduce design pattern to my colleague (that's why I said it's an objective) Commented Jul 6, 2017 at 15:55
  • Where do you usually put repositories? Or DAOs? The websocket is a DataSource (more or less) Commented Jul 6, 2017 at 18:29
  • 1
    Why does the message have to go through the Presentation? The MV* patterns only concern themselves with user-interaction and it is kinda implicit that the Model can change its state autonomously due to triggers that are not initiated by the user. Commented Jul 13, 2017 at 10:52

0

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.