Coffeehouse Thread

12 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

MVC Question

Back to Forum: Coffeehouse
  • User profile image
    SaraJoRedux



    Ok, so, the reason I am using MVC (aside from the fact that the fine folks at Microsoft made it) is because of the mega snazzy url rewriting. I need to be able to have customers type in mydomain.com/clientname and be taken to their own personalized section of the site. 

    MVC does enable me to do that, no? I would just have to have the index check for a query string text value and use it to find the customer ID then do a redirect?

    It makes sense that I would be able to do that, I just wanted to make sure before taking the plunge.  

  • User profile image
    Bas

    Yes. You can define your own routehandlers and such.

  • User profile image
    Chadk

    Bas said:
    Yes. You can define your own routehandlers and such.
    This is hardly anything new. Rails can do this too, and it's in v2 already. ASP.NET MVC is pretty much just a copy of that, which isn't even V1.

    Mind you, Rails is much more mature. It even has it's own data layer!

  • User profile image
    SCMcDonnell

    Chadk said:
    Bas said:
    *snip*
    This is hardly anything new. Rails can do this too, and it's in v2 already. ASP.NET MVC is pretty much just a copy of that, which isn't even V1.

    Mind you, Rails is much more mature. It even has it's own data layer!
    Rails is a hog.

  • User profile image
    wisemx
  • User profile image
    Human​Compiler

    wisemx said:
    Yah and also, wasn't the url routing stuff pushed back into ASP.NET for everyone to get some love .NET 3.5 SP1?

  • User profile image
    TommyCarlier

    HumanCompiler said:
    wisemx said:
    *snip*
    Yah and also, wasn't the url routing stuff pushed back into ASP.NET for everyone to get some love .NET 3.5 SP1?
    Yes. .NET 3.5 SP1 contains URL Routing, but not ASP.NET MVC.

  • User profile image
    harumscarum

    wisemx said:
    sure let me just install IIS7 on my xp box, damn, now let me try my 2003 box, damn again....

  • User profile image
    Bas

    Chadk said:
    Bas said:
    *snip*
    This is hardly anything new. Rails can do this too, and it's in v2 already. ASP.NET MVC is pretty much just a copy of that, which isn't even V1.

    Mind you, Rails is much more mature. It even has it's own data layer!
    Nobody claimed that it was new. Somebody just asked if it was possible. And it is.

  • User profile image
    SaraJoRedux

    Bas said:
    Chadk said:
    *snip*
    Nobody claimed that it was new. Somebody just asked if it was possible. And it is.
    So wait, I don't have to use MVC to take advantage of the url rerouting?


    forgive my nievete, but what is different about an MVC application?

  • User profile image
    Sampy

    SaraJoRedux said:
    Bas said:
    *snip*
    So wait, I don't have to use MVC to take advantage of the url rerouting?


    forgive my nievete, but what is different about an MVC application?
    Normal ASP .Net Page Model
    1. Figure out which page to load and call (Normally done with filesystem but you can introduce modules or Virtual Path Providers to make it more interesting)
    2. Call the ProcessRequest method on the Page
    MVC Model
    1. Use Routing to find the Controller object to call
    2. Call controller object's action method
    3. Find View to call
    4. Load view and send to client
    The big difference is that MVC explicitly splits "business logic" and display into two actions. The other cool thing about the model is that everything is replaceable. You can write your own code for routing, finding the right controller, calling the controller method, finding the view, processing and sending the view, etc. Everything is also based on abstractions of the ASP .Net environment classes like HttpRequest and HttpContext which makes unit testing and test-first development, TDD, easier.

    I'm a big fan of this new system. It takes me back to writing web apps in Perl in college where I basically used the same model where one object performed the requested user action and the other displayed the HTML/JS.

  • User profile image
    Ion Todirel

    Sampy said:
    SaraJoRedux said:
    *snip*
    Normal ASP .Net Page Model
    1. Figure out which page to load and call (Normally done with filesystem but you can introduce modules or Virtual Path Providers to make it more interesting)
    2. Call the ProcessRequest method on the Page
    MVC Model
    1. Use Routing to find the Controller object to call
    2. Call controller object's action method
    3. Find View to call
    4. Load view and send to client
    The big difference is that MVC explicitly splits "business logic" and display into two actions. The other cool thing about the model is that everything is replaceable. You can write your own code for routing, finding the right controller, calling the controller method, finding the view, processing and sending the view, etc. Everything is also based on abstractions of the ASP .Net environment classes like HttpRequest and HttpContext which makes unit testing and test-first development, TDD, easier.

    I'm a big fan of this new system. It takes me back to writing web apps in Perl in college where I basically used the same model where one object performed the requested user action and the other displayed the HTML/JS.
    in our project we used that approach for years Tongue Out (our approach uses pure xml for writting the rutes) pretty cool, yes, wondering what will we do after MVC comes out of beta... probably nothing thought Smiley

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.