tags:

views:

223

answers:

3

I am familiar with MVC/MVP though my question is simple, I'm about to program a simple Instant Messaging software when the engine and communication part is an open API. so my software will have about 3 forms, a splash screen with login details, the options form and a main form with all the functionality like: Friends List, Send message, Received messages (tabbed), search user, etc.

In UI perspective, its important for the GUI to be in 1 form in my application.

So my question is, for the only complicated form that I'm going to have, is it necessary to implement an MVP design pattern or in this case its better to just go straight forward and put all the logic in 1 place?

THANKS

Janalopa!

+2  A: 

I think that is always best to have a separation of concerns, particularly in the GUI.

sgrassie
+1 Absolutaly. Keep as much code as you can out of the UI and into the model as you can.
griegs
A: 

My 2 cents worth is to always code in an MVC way. If it's worth coding it's worth coding well.

Ask yourself whether you can see your application growing past the current spec? It's going to be easier to code against an mvc framework than any other.

Anyway, MVC! :)

griegs
A: 

If you wish to expose an API to your web app, you definitely benefit from a clear separation of concerns. If MVP or another pattern is the right way to go is up to you, but you should try to have your app as loosely coupled as possible, so that you can

a) test it

and

b) expose it at whichever level that feels appropriate.

For example, you might want to start with writing your own chat form that posts and gets updates from a DB. If you have a loosely coupled server side app behind it, you can choose whether to expose the chat at the repository level, service level, controller layer or with a separate API layer that interacts with the same interface as your own UI.

EDIT: As a final comment, if you're starting with a new project a chat is definitely much easier to implement in ASP.NET MVC than WebForms, as MVC is in many ways easier to work with ajax calls and updates.

Tomas Lycken