Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6549237
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T12:04:07+00:00 2026-05-25T12:04:07+00:00

i’ve created a forum system in MVP pattern but i’m not sure if i

  • 0

i’ve created a forum system in MVP pattern but i’m not sure if i implemented it in a right way. so here is what i ended up with:

  • i’ve created a database which has three tables: forums, threads, posts
  • added a new typed dataset to the project and then dragged all the tables into it
  • created three new calsses: ForumsModel, ThreadsModel, PostsModel
  • added three interfaces: IForumView, IThreadView, IPostView
  • three more classes: ForumsPresenter, ThreadsPresenter, PostsPresenter

inside the model classes i just call the typed dataset methods and in presenter i’ve called the model methods. the views are .aspx pages. that’s all there is for the forums system but here is the tricky part:

since MVP pattern is an UI pattern i have to do the validations of data in Application itself. so with my design the MVP is the application!

what did i do wrong??

edit 1: first of all about why i chose typed dataset with stored procedures over other options: it’s the lightest data provider that doesn’t compromise whatever architecture you have. other options are direct sql which is not a good option for newly created application, LINQ to sql classes which are too heavy to be instantiated with each request, Entity Framework which is great but is too much for such a simple task! at least if i was creating a blog engine it would have been my first choice.
as for the why i didn’t choose MVC, it’s because i think MVP is the better pattern since it’ll give me complete seperation of different parts of my application. at the end it’s a matter of tase but you should be able to implement any pattern, right?
i’ve seen different flavors of MVP but the one i’m trying to implement is this:

model<------------->presenter<-------------->view

the databind option is for the presentation model pattern which is introduced by martin fawler as far as i remember but the one i’m trying to create is a microsoft version which basically is an extended version of the PM pattern.

two days ago i asked a question about data validation and someone suggested that i should do it in “Application itself” so when i asked where is this “Application” he said that the MVP is an UI pattern and it shouldn’t be your “Application” and you should implement the MVP in your user interface layer. so that’s the reason i asked this question at the first place!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T12:04:08+00:00Added an answer on May 25, 2026 at 12:04 pm

    With MVP the code behind becomes the View implementation based on a View interface.

    The View interface contains the page events the Presenter will need to bind to in order to change the state of the View, as well as properties and methods it might need. For instance it could hook onLoad event and call into the View to change it’s state. In doing this it’s agnostic to the View implementation and knows nothing about controls. This means you can write unit tests without an ASPX instance.

    To create a MVP engine that automates wire up, you would make use of a base page, generics and IoC. The IoC allows you to set dependency overrides for things like WebContextBase which is visible to only that request pipeline, and which can be passed to your Presenter constructor.

    IoC also allows you to inject other dependencies Into your Presenter to help keep it light weight. This way you can move business and data access to other layers.

    MVP is really useful where you have to use WebForms, such as with most CMS systems. If you aren’t constrained, then use MVC.Net for new web development.

    Update: As promised here’s a fairly decent example. The bit it’s missing is the dependency overrides which can be done like this:

    var dependencies = new DependencyOverrides
                        {
                            {typeof (HttpRequestBase),new HttpRequestWrapper(Request)},
                            {typeof (HttpResponseBase),new HttpResponseWrapper(Response)},
                            {typeof (IPrincipal),Context.User},
                            {typeof (IIdentity),Context.User.Identity},
                            {typeof (IUserProfile),Context.User.Profile},
                            {typeof (HttpSessionStateBase),new HttpSessionStateWrapper(Session)}
                        };
    
    presenter = container.Resolve<TPresenter>(dependencies);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I need a function that will clean a strings' special characters. I do NOT

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.