Results 1 to 30 of 30

Thread: Mvc

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Mvc

    Thoughts? Opinions? Rants? Anyone developed a major app in it yet?

  2. #2
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Mvc

    Hey,

    I haven't developed any major app with it, but I did spend quite a bit of time looking into it and what it could do.

    From what I saw, it seems very powerful, although the only criticism was that it involved quite a bit of server side interaction within the client markup, with is something that I tend to shy away from in normal ASP.Net applications.

    Are you away to be using this, or are you just reading up on it.

    I think Stranger has been working on this a lot, he might be able to give you some more insight.

    Gary

  3. #3

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Mvc

    Quote Originally Posted by gep13 View Post
    Hey,

    I haven't developed any major app with it, but I did spend quite a bit of time looking into it and what it could do.

    From what I saw, it seems very powerful, although the only criticism was that it involved quite a bit of server side interaction within the client markup, with is something that I tend to shy away from in normal ASP.Net applications.

    Are you away to be using this, or are you just reading up on it.

    I think Stranger has been working on this a lot, he might be able to give you some more insight.

    Gary
    Hey,

    No there is no specific need for it, I have 2 new projects im about to start on and also a contract where they are interested in MVC so I thought I best do my homework.

    I'm tempted by it, but not convinced. I've only really discovered it as Ive dropped Subsonic and started toying with the Entity framework.

    Pino

  4. #4
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Mvc

    I just deleted all I wrote and post this link (been posted over and over, but the dude really say it all)

    If anyone want my advice, yes, give it a go. Everyone should.

    Only b!tch is it's evolving so fast. I got books from each release that render itself pretty useless every few months. That's why smart dudes like Mendhak and Gary sit in the tree waiting for things to calm down first.

    ps: that link dont work in china now, but not sure it's because i'm here or the site is down?
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  5. #5

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Mvc

    Quote Originally Posted by StrangerInBeijing View Post
    I just deleted all I wrote and post this link (been posted over and over, but the dude really say it all)

    If anyone want my advice, yes, give it a go. Everyone should.

    Only b!tch is it's evolving so fast. I got books from each release that render itself pretty useless every few months. That's why smart dudes like Mendhak and Gary sit in the tree waiting for things to calm down first.

    ps: that link dont work in china now, but not sure it's because i'm here or the site is down?
    Yea it works here, I think im going to wait for it to become more established before doing anything on a production basis.

    CHeers

  6. #6
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Mvc

    Quote Originally Posted by Pino View Post
    Yea it works here, I think im going to wait for it to become more established before doing anything on a production basis.
    CHeers
    Hope you all does! For once I'll be the one with answers! lol

    Just remember all the asp.net you do now are useful in mvc. It's just a different way of doing something and sit on top of asp.net.
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  7. #7
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Mvc

    Only b!tch is it's evolving so fast. I got books from each release that render itself pretty useless every few months. That's why smart dudes like Mendhak and Gary sit in the tree waiting for things to calm down first.
    Hey,

    I wouldn't go as far as to say that I am "smart" in this case, normally I am a bleeding edge kind of a guy, but we just haven't had any applications that require it yet, and I haven't had the spare time to give it a proper work out though. I am keeping my eye on it though, Scott Guthrie's blog in on my RSS feed, so I always see when new stuff is happening.

    Gary

  8. #8
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Mvc

    Quote Originally Posted by gep13 View Post
    Hey,
    I wouldn't go as far as to say that I am "smart" in this case, normally I am a bleeding edge kind of a guy, but we just haven't had any applications that require it yet, and I haven't had the spare time to give it a proper work out though. I am keeping my eye on it though, Scott Guthrie's blog in on my RSS feed, so I always see when new stuff is happening.
    Gary
    Just my way of speaking..thought you would be used to it by now. Ok...off my "smart dudes" list.
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  9. #9
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Mvc

    I'm afraid I'm lost... is there some product called 'MVC', as opposed to the design pattern?

  10. #10
    Super Moderator Shaggy Hiker's Avatar
    Join Date
    Aug 2002
    Location
    Idaho
    Posts
    40,106

    Re: Mvc

    Quote Originally Posted by StrangerInBeijing View Post
    Only b!tch is it's evolving so fast. I got books from each release that render itself pretty useless every few months. That's why smart dudes like Mendhak and Gary sit in the tree waiting for things to calm down first.
    I don't think that is why they are in the tree. I think they were actually chased up there by a herd of feral lolcats.

    The whole pace of acronym proliferation from MS seems to have accelerated in the last few years. They may or may not have coined the term TLA, but they have certainly bought in heavily. MVC, MCF, MPF, and on and on. They are hitting us with acronyms faster than we can keep up (at least those of us working on projects that take more than a year). I have not the slightest idea what MVC even stands for. Learning never ends.
    My usual boring signature: Nothing

  11. #11
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Mvc

    Quote Originally Posted by penagate View Post
    I'm afraid I'm lost... is there some product called 'MVC', as opposed to the design pattern?
    Hey,

    Microsoft have released an implementation of the MVC design pattern, called ASP.Net MVC:

    http://www.asp.net/mvc/

    At least, that is what I was assuming Pino was referring to.

    Gary

  12. #12
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Mvc

    Quote Originally Posted by Shaggy Hiker View Post
    I don't think that is why they are in the tree. I think they were actually chased up there by a herd of feral lolcats.
    Ha ha

    Quote Originally Posted by Shaggy Hiker View Post
    I have not the slightest idea what MVC even stands for. Learning never ends.
    What is it they say about old dogs and new tricks MVC stands for Model View Controller. Simply put a design pattern that separates logic into three distinct areas. It it by no means a new pattern, but recently Microsoft have brought out their version of it for ASP.Net.

    Gary

  13. #13
    I'm about to be a PowerPoster!
    Join Date
    Jan 2005
    Location
    Everywhere
    Posts
    13,647

    Re: Mvc

    Quote Originally Posted by gep13 View Post
    Hey,

    Microsoft have released an implementation of the MVC design pattern, called ASP.Net MVC:

    http://www.asp.net/mvc/

    At least, that is what I was assuming Pino was referring to.

    Gary
    Ah, so. Thanks.


    Could you elaborate on your criticism (server/client interaction)?

    As a pattern, MVC is designed to distinctly separate each layer, so I find this remark intruiging. Perhaps Microsoft have their own interpretation of the "view" layer.

  14. #14
    Frenzied Member StrangerInBeijing's Avatar
    Join Date
    Mar 2005
    Location
    Not in Beijing
    Posts
    1,666

    Re: Mvc

    IMO it's so simple to use, it would be a shame not to install it (takes like 5 minutes to download and install mvc) and do the free nerddinner tutorial to get the hang of things.

    Will take you about a Saturday morning and you pretty much will have seen every part of mvc. Very Simple, yet covering quite a bit. (Though, you wont use it exacly like that in larger applications.)
    Install and Configure Eclipse For both Java and PHP development
    Accessible Ajax/jQuery Forms Degrade gracefully with JavaScript Disabled

  15. #15
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Mvc

    Quote Originally Posted by penagate View Post
    Ah, so. Thanks.


    Could you elaborate on your criticism (server/client interaction)?

    As a pattern, MVC is designed to distinctly separate each layer, so I find this remark intruiging. Perhaps Microsoft have their own interpretation of the "view" layer.
    Hey,

    In standard ASP.Net, I see a lot of people doing something like this:

    Code:
    <asp:Label ID="Label1" runat="server" Text=<%# Container.ItemIndex %> />
    NOTE: Crude example, but just trying to illustrate point.

    I used to do things like this, especially when binding to DataSource's, but after reading Mendhak's article here:

    http://www.codeguru.com/vb/vb_intern...cle.php/c14739

    I saw the errors of my ways, and started doing everything in the correct place, i.e. RowDataBound events, etc. As a result, there is hardly ever any server tags in my ASPX markup.

    Along comes ASP.Net MVC framework, and this all changes. There are a number of reasons for this, but it just messes with the brain slightly, especially when you start seeing things like are mentioned here:

    http://weblogs.asp.net/scottgu/archi...-released.aspx

    For instance:

    Code:
    <% using (Html.BeginForm()) { %>
    
    //stuff
    
    <% } %>
    To me, this takes you back more to a single file scenario, more like php, than ASP.Net.

    Don't get me wrong, I like the pattern, and what they are trying to do, and I haven't played with ASP.Net MVC enough to form a proper opinion based on actually using it, this was just my immediate reaction.

    Gary

  16. #16
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mvc

    I am currently in the throes of developing a web site for the New South Wales (Australia) Department of Health to display hospital waiting times using ASP.NET MVC. There's a public-facing web site for the final results and a private site for administration.

    I never much liked web development because Web Forms seemed like a kludgy version of WinForms. It felt like they were trying to make something work like WinForms when it was a fundamentally different beast, which is exactly the case. This is not a criticism per se because I think they probably did about as good a job as they could of making the stateless web appear to behave like a Windows app. It just didn't feel right to me though.

    Now with MVC, web development has become more different to Windows development than it was before, yet I feel more at home. MVC just feels more natural for web development and I genuinely enjoy using it, where Web Forms was a chore. I've still got plenty to learn on the subject but I suspect I'll enjoy it more and more, especially as the MVC Framework matures.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  17. #17

    Thread Starter
    PowerPoster
    Join Date
    Dec 2003
    Posts
    4,787

    Re: Mvc

    Anyone done anything more with this yet?

    I've spent the last 4 months working with it for a large local goverment site and while initially I was frustrated now I've got my head around it I can see its power and flexibility. Although there are not many questions on this board regarding it yet.

    Thoughts, opinions, fire away.

  18. #18
    New Member
    Join Date
    Mar 2010
    Posts
    10

    Re: Mvc

    I have got a question: how do the three parts interact? Is the view supposed to interact with the model or not?

  19. #19
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mvc

    Quote Originally Posted by Grhymn View Post
    I have got a question: how do the three parts interact? Is the view supposed to interact with the model or not?
    In MVC, yes. In MVP, no. That said, there's only a certain level of interaction. In ASP.NET MVC, the model is the data and the low-level data access code. The user invokes a controller via a URL, the controller invokes the code part of the model to get the data part of the model. The controller then passes the data part of the model to the view, which presents it to the user. That's why each view has an inbuilt property named Model.

    In some cases, the pattern of the data required by the view doesn't really match the model directly. In that case, the controller processes the data and passes it to the view in some other form. This is generally termed a "view model", i.e. it is a model specifically created for a particular view. A view model class would be created in the Models folder of your MVC project, which may or may not be where the main model is stored. In many MVC apps you will create the model in a completely separate project. You might also create your service layer in a separate project, in which case the Models folder might exclusively contain view model classes.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  20. #20
    New Member
    Join Date
    Mar 2010
    Posts
    10

    Re: Mvc

    In some cases, the pattern of the data required by the view doesn't really match the model directly. In that case, the controller processes the data and passes it to the view in some other form. This is generally termed a "view model"
    So the view model is part of the controller?

  21. #21
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mvc

    Quote Originally Posted by Grhymn View Post
    So the view model is part of the controller?
    No, it's part of the model, but a model specifically created for a view. For instance, I'm using the Entity Framework in a current project. The EF model closely follows the database schema and that's fine in the majority of cases. In one or two cases though, the structure of the data displayed by a view doesn't look like a single record or a single table from the database. In those cases, my service layer retrieves data from the EF model and massages it into a view model, which then gets passed back to the controller, which passes it on to the view. The view model class is declared in the Models folder of your MVC project, even if your actual model exists in a separate project altogether, as mine does.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  22. #22
    New Member
    Join Date
    Mar 2010
    Posts
    10

    Re: Mvc

    Thank you for the clarification

  23. #23

  24. #24
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: Mvc

    I just wanted to add on these whole pattern things I've been playing with MVVM which is essentially MVC for silverlight and wpf with a View Model as opposed to a controller and I have to say my whole method of programming from charting out a project to first implementation has changed. It was really hard at first because there are certain happens one picks up that rub against the pattern but after a while it just seems to be a more natural way of programming!

  25. #25
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Mvc

    Hey Dean,

    Have you also adopted the philosophy of TDD (Test Driven Development) or have you not went that far yet?

    Gary

  26. #26
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: Mvc

    No because I cannot find anything on testing except how wonderful it is. For instance I have a few books on agile development which both say TDD is the bogs dollox and show two examples of why it is so and thats it.

    What about you Gary are you a TDDer?

  27. #27
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Mvc

    Hey,

    No, we're not. We are lucky if we create any unit tests

    I was at a talk recently by Scott Guthrie, and he was advocating the use of ASP.Net MVC 2.0, and TDD, and a couple of guys that I spoke to there said that they had been using it for a while, and have never looked back, so was just wondering what other people were saying on the subject.

    I think in general, it makes a lot of sense, but it is a big mind switch to start implementing properly. Scott showed an example of how to create a test, initially have it fail, and then write code to make the test work, but it was a very simple example, so I don't know how it would work when you start to get into more complex scenarios.

    We have recently started using the SCRUM methodology, but a switch to TDD is a long way off yet.

    Gary

  28. #28
    Frenzied Member
    Join Date
    Jul 2008
    Location
    Rep of Ireland
    Posts
    1,380

    Re: Mvc

    That was the way I was shown in tutorials I have seen regarding testing. Essentially you make everything bit sized to the point where you would write an empty method that fails you then add to it until it does not fail, you then have a method that has been engineered as little as possible to work. The theory behind this is each method only gets as much attention as it needs to work and over engineering becomes moot..

    Of course this still leaves the big, show me how to test correctly, hole in my developmental efforts. I have also found lately that there is so much knowledge floating around that one of the skills a programmer needs is to sort out which is relevant and which is not. Filtration seems to be something I am slowly but surely getting better at.

  29. #29
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Mvc

    I like the looks of TDD but it's a bit of a mind-shift. We're not going to go that way at work so it's a bit tricky for me to go that way myself. I've definitely gained a better understanding of how to implement unit testing since using MVC though.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  30. #30
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    Re: Mvc

    Yeah, that is a valid point. MVC and unit testing seem to very much go hand in hand, to the point that when you create an MVC application, it prompts you to create Unit Tests.

    Going to have to spend some more time with it though, as I don't think it is something you can pick up over night.

    Gary

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width