Click here to Skip to main content
15,896,269 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: MVP implementation questions Pin
Nathan Gloyn16-Jan-09 4:00
Nathan Gloyn16-Jan-09 4:00 
GeneralRe: MVP implementation questions Pin
N a v a n e e t h16-Jan-09 5:05
N a v a n e e t h16-Jan-09 5:05 
GeneralRe: MVP implementation questions Pin
Nathan Gloyn16-Jan-09 5:38
Nathan Gloyn16-Jan-09 5:38 
GeneralRe: MVP implementation questions Pin
Jon Rista16-Jan-09 5:59
Jon Rista16-Jan-09 5:59 
GeneralRe: MVP implementation questions Pin
Nathan Gloyn16-Jan-09 8:50
Nathan Gloyn16-Jan-09 8:50 
GeneralRe: MVP implementation questions Pin
Jon Rista16-Jan-09 9:21
Jon Rista16-Jan-09 9:21 
GeneralRe: MVP implementation questions Pin
Nathan Gloyn16-Jan-09 9:41
Nathan Gloyn16-Jan-09 9:41 
GeneralRe: MVP implementation questions Pin
Jon Rista16-Jan-09 10:02
Jon Rista16-Jan-09 10:02 
Ok, before I dive into anything else...I think a critical distinction is that Model is most definitely not state. In your case...your model is storing both business data and state. Thats a blending of concerns, and a fairly critical one at that. Its very important to maintain a separation between business modeling facilities, and user state facilities. User state is transient, it lasts for the duration of the users visit and then dissapears. Model state is, generally, persistant...regardless of where it is stored. The purpose of state data and model data is also generally very different. You have connected two concerns into your model objects that, before anything else, should be separated into isolated facilities that serve just one function. So you need one system to manage state, and another to manage business. Management, or orchestration, of the two...state and business data, would then be done by a third facility...quite possibly the presenters, or maybe another system that the presenters use. But I would say its very, very important to separate state from your model...otherwise I am not sure that a viable implementation of an MVP can really be achieved.

A good way to put it is that state is part of context. Context always exists, sometimes its not very obvious. Context also exists at various levels...application, thread, call, etc. Another important aspect about context is that it is a cross-cutting concern...it spans layers and levels of code. This should clarify why state (context) doesn't belong in a model object.

If you can separate these concerns properly, you should be able to avoid even having to simulate HttpSessionState for unit testing, as you should be able to create your own custom session object that would in turn delegate to either HttpSessionState (for an actual representation), or possibly just a dictionary or hashtable (for a mock representation).

Is there any way you can show an example of one of your model objects? I may be able to help you separate state out of them, but still allow you to achieve the kind of muti-tennancy you need (if you don't know this term, it pretty much referrs to the way you store data in different databases for different customers).
GeneralRe: MVP implementation questions Pin
Nathan Gloyn16-Jan-09 10:17
Nathan Gloyn16-Jan-09 10:17 
GeneralRe: MVP implementation questions Pin
Jon Rista16-Jan-09 10:58
Jon Rista16-Jan-09 10:58 
GeneralRe: MVP implementation questions Pin
Nathan Gloyn19-Jan-09 8:25
Nathan Gloyn19-Jan-09 8:25 
GeneralRe: MVP implementation questions Pin
Jon Rista19-Jan-09 9:55
Jon Rista19-Jan-09 9:55 
GeneralRe: MVP implementation questions Pin
Nathan Gloyn19-Jan-09 10:54
Nathan Gloyn19-Jan-09 10:54 
GeneralRe: MVP implementation questions Pin
Nathan Gloyn3-Feb-09 9:50
Nathan Gloyn3-Feb-09 9:50 
Questionaccess denied for CreateObject("Outlook.Application") Pin
NidhiKanu15-Jan-09 19:41
professionalNidhiKanu15-Jan-09 19:41 
AnswerRe: access denied for CreateObject("Outlook.Application") Pin
Rutvik Dave16-Jan-09 3:49
professionalRutvik Dave16-Jan-09 3:49 
AnswerRe: access denied for CreateObject("Outlook.Application") Pin
Christian Graus25-Jan-09 0:43
protectorChristian Graus25-Jan-09 0:43 
GeneralRe: access denied for CreateObject("Outlook.Application") Pin
NidhiKanu26-Jan-09 18:35
professionalNidhiKanu26-Jan-09 18:35 
Questiongridview rendering from 2 database tables Pin
billcodes15-Jan-09 19:35
billcodes15-Jan-09 19:35 
AnswerRe: gridview rendering from 2 database tables Pin
Abhijit Jana15-Jan-09 20:04
professionalAbhijit Jana15-Jan-09 20:04 
QuestionGridview Pin
kushalrshah15-Jan-09 19:29
kushalrshah15-Jan-09 19:29 
AnswerRe: Gridview Pin
Abhijit Jana15-Jan-09 19:37
professionalAbhijit Jana15-Jan-09 19:37 
Questioni have problem in displaying hover dynamically Pin
Rahul Gharat15-Jan-09 18:28
Rahul Gharat15-Jan-09 18:28 
AnswerRe: i have problem in displaying hover dynamically Pin
Christian Graus25-Jan-09 0:42
protectorChristian Graus25-Jan-09 0:42 
QuestionFile Upload Filter? in VB ASP .net Pin
saberbladez15-Jan-09 16:23
saberbladez15-Jan-09 16:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.