What to choose (in ASP.NET MVC) for a new webshop project? - asp.net-mvc

What to choose for the foundation of a new webshop project? I have narrowed down my options into using ASP.NET MVC, so that is a must. That leaves me with:
Rob Conery's Kona (not being updated anymore but all in all seems a good foundation, though with a huge amount of features)
MVC MusicStore by Jon Galloway (very simple, in fact it could be easier to start from scratch and take in consideration all the special details we need)
Start from scratch
Anything else?
I've worked with the MVC for the last year so I could start from scratch and have the basic functionality developed in no time but I like Rob's extended functionality he added.
It is just that I am unsure how difficult it is to tailor Kona to our individual needs - anyone tried it yet? For instance, use EF instead of NHibernate?

To be honest, half the fun with Rob Conerys series was being "there" during the process he went through and the trials and tribulations he encountered. If you already have a foundation of using MVC for a year i'm not sure if there'd be too much more to take from it.
The most fundamental thing about the MVC pattern and the .NET tools that come into their own with using it (extension methods baby!), is that there are so many ways of solving the problem, some good, some better and occasionally some that make you go BAZINGA!.
If you have the time, i'd highly recommend just hacking away and see what you come up with.
After you've got a working prototype it's always good to then compare to what else is out there, for example with something like this post

You could also consider using Rob's new starter site: "Tekpub MVC 2.0 Starter Site". It's inspired loosely on his experiences with Rails, and has a bunch of nice utilities built in from the get-go. It's built as a result of his MVC 2.0 course on TekPub, which he recorded with Steven Sanderson.

Related

Any more ASP.NET MVC Frameworks like SharpArchitecture around?

Are there more ready-to-use MVC frameworks like SharpArchitecture?
For the small to medium projects I will be working on, SharpArch looks like an overkill to me. Plus I'm not yet very familiar with Domain Drive Development (but that is one thing I want to read about as soon as my time permits, it definitively sounds interesting)
Please link to all frameworks you know about. I don't have any requirements about the technology being used.
If you're working on small to medium-size projects, then go with pure ASP.NET MVC - this already is a highly sophisticated framework.
You may consult a book like ASP.NET MVC in Action to understand how to best work with it and how to extend it, if necessary. Forget about other things for the moment, the learning curve would be very steep for you, and you most likely will end up in the middle of nowhere...
Thomas

Worth using ASP.Net MVC for hobby project?

I'm quite a proficient ASP.Net Web Forms developer, but I would like to get some exposure to MVC to see what it's like and if there are benefits to using it.
Is it worth using MVC for a hobby project, my main concerns are:
It may hinder development times of the website
I may not appreciate any rewards for using MVC (i.e. testability)
Are my concerns reasonable?
Thanks
A hobby project may in fact be a perfect introduction to MVC if you want to learn it. I thoroughly recommend having a play. If you haven't used MVC before I wouldn't attempt it for a large scale project, smaller projects like you may be undertaking are great stepping stones for learning the new framework.
Of course, you've got to weigh up hindrance against progress. The time taken may hinder this project, but in the long term, getting an introductory exposure now has got to out weigh that?
I started a hobby-project earlier this year in ASP.NET MVC (later upgraded to MVC2), and it's the single best learning experience I've had the last few years.
So my answer is a definite 'YES'
Do it, and try to exploit as much of the features in MVC2 as possible. Strive to do things as simple and reusable as humanly (or maybe technically) possible, and you'll be a master in MVC2 in no time :D
Why not?
You say it's a pet project, so time is not really an issue. Given a good book, or based on the examples on the ASP.NET site, you should be able to get up to speed fairly quickly.
Testability is one of the strong points for ASP.NET MVC, so maybe you should try writing tests and decoupling your views from business logic? Who knows, you may like it. Either way, doing so will allow you to claim personal experience of using a new technology on your CV, plus learning something new is always fun.
You'll learn from it and can then take it into a work situation. And besides that, it's nicer to work with than web forms...
I certainly wouldn't want my first venture into a new technology to be a live project so I'd certainly recommend starting a hobby project.
Throughout your first development in ASP.NET MVC you will probably make architectural mistakes whilst you get used to the MVC pattern. You will also find yourself without much of the WebForms functionality and will need to think about how best to apply your design to the technology.
Essentially, you'll learn whether it is worth using it or not throughout the project. A decent rule-of-thumb is that any project that will take you more than a couple of months development time will probably be better developed with MVC.
Just to add to the above, I too would recommend you play with MVC. I've found that I'm actually more productive in MVC than in Web Forms.
In case you have not found this tutorial, highly recommended as a beginners guide and written by Scott Guthrie:
Html Version
PDF Version

Asp.Net MVC - New Project How to Begin?

I’m new to asp.net and the mvc framework and I’m trying to learn by using the asp.net learn tutorials for Building a Contact Management Application in vb (http://www.asp.net/learn/mvc/tutorial-29-vb.aspx).
The question I have is that I would like to begin a new project to start using mvc, but how do I start….
The tutorials start by putting data access and logic into controllers at first and then making the application loosely coupled by refactoring the code.
Is this the way to approach a new project or should I be making the application loosely coupled from the start?
I have followed the next iterations of the tutorials about TDD but couldn’t get my head around that just yet and wanted to really focus on cementing what I’ve picked up so far.
Any help or advice would be great.
I would probably check out the NerdDinner sample app and eBook. It provides some pretty good direction on the best way to do things. Link Here
Id recommend jumping straight into the sharp architecture stuff.
http://www.sharparchitecture.net/
Rob Conery has a good series of walkthroughs in regards to creating an asp.net mvc storefront application. I think they include TD stuff, but are done in C#. Here is the link.
I don't mean to scare you but I wasn't really productive until my 4th project.
Sure, I managed to hack out a few sites but if anyone looked at the code I wouldn't own up to it! :)
Nerd Dinner is certainly the place to start. I also found this site to be one of the most useful.
The trick I found was to, once Nerd Dinner was out the way, pick a pet project and get into it. Then, I picked another pet project and corrected the mistakes I made in the previous one. The 4th project actually resembled a well written site.
It's just because the paradigm for writing sites in mvc is so different that there is a pretty big learning curve. At least that's been our experiance here.
I also recommend S#arp all the time. I was novice to IoC, NHibernate, and MVC when I started, and S#arp was a big help. As for VB, S#arp can be used as binary assemblies; however this surely won't be as easy.
For VB/C# look here: https://stackoverflow.com/questions/1653895/should-i-learn-vb-net-or-c. I personally rarely answer VB questions, and I find C# lambda very helpful, so I can confirm many points there.
But if you only need to learn MVC, not to start real project, NerdDinner will do. Just don't take it as real-world best practices; it's to teach MVC stuff/features, not how to write well-designed and maintenable programs.

ASP.Net MVC issues, meant for advanced developers only?

Just a random question. I've been in internship and then working as a software designer for almost a year now, mainly with SQL Server 2005 / 2008, and Visual Studio 2008 with ASP.Net VB / C#, web software development. We recently started a project with ASP.Net MVC, and I just don't get this stuff.
The concept of Views, Controllers, Models etc is clear. I'm still a bit confused with some of the syntax, but it doesn't seem impossible to get. My problem however, is with all the basic controls and functions you had with basic ASP.Net. Want a dropdownlist? Go browse through 15 tutorials one of which may actually work. How about a gridview with editable rows? Manually build the tables or helper classes with loads and loads of code also built from several different tutorials. What about panels or multiview indexes to easily control the visible user-interface on a page? Well, go learn another tutorial about how to do it all from scratch. Etc..
I do not argue the idea that MVC is worth it. It has to be, with so many people smarter and more experienced than I am saying so. But I've now fought with this beast for over a month and am getting increasingly frustrated at having to use hours to days of time to do the most basic tasks that were easy even when I was barely beginning with the whole programming thing almost a year ago.
So my question. Are there others out there like me? Are there perhaps nice blogs or articles opening all this up to people like myself? Is ASP.Net MVC just something that is so hardcore advanced that you NEED to have extensive experience and talent to actually master it?
Thanks for your time.
It's not for advanced developers. It is for good developers.
Most ASP.NET WebForms developers have made it somehow through years without having a slightest idea of HTML, CSS, JavaScript or HTTP. Drag and drop some control, set up some properties and here you go. It is not the way of a professional. You need to know the basics. It is only a matter of time until some situation arrives where a standard control cannot help and you need to work around the postback mechanism, viewstate etc.
I agree that it is definitely more work trying to implement an editable data grid, add persistance for controls, add some nice Ajax effects instead of relying on UpdatePanels, yes. But you really need to know this stuff if you wish to be working as web developer.
What you are experiencing is being overwhelmed at once by all those things you should have learned already but have managed to postpone thanks to very well done abstraction mechanism of WebForms. The best course of action is to start learning these things now, step by step. It will likely take you at least 6 months of intensive studies to feel more or less confident with doing stuff manually. But when you have done this, you will be looking back at your start and feeling glad you did it.
I was trying to work out what the problem was with MVC until I grasped the essential difference between the person asking the question and me - it would be this, I first laid hands to keyboard in 1979 whereas Zan has been "working as a software designer for almost a year now".
When I started one more or less had to do everything (at least in terms of presenting a UI) from scratch - or at least using far more limited toolkits than is the case today. The notion of constructing a drop down list by running a loop to create the options is in some respects considerably less alien to me than binding a datasource to a control and having the result appear as if by magic (notwithstanding 9 years of VB.OLD and over 6 years of .NET and C#)
And that is the core difference between Forms and MVC as it currently stands - the way you produce the presentation code and consequently the fact that you need to understand HTML and do seemingly more work to achieve similar results (and this is one of the reasons that people keep emphasising, quite rightly, that MVC is NOT an appropriate solution for every project). In terms of the structure of an application - MVC encourages a better (more testable) style but its not the only means to achieve that end - the majority of the techniques are as applicable using forms and alternative patterns.
And again this raises the challenge of contemporary frameworks and tools - they do a huge amount of work for you (go look at Dynamic Data for example) but they also hide so much from you that we lose track of the fundamentals and of an understanding of the basic building blocks from which our complex applications are constructed. In this case the problem sounds like one I've had which is learning about the nuts and bolts how a web page is actually constructed (HTML, CSS, Javascript) and how it interacts with the server as opposed to just having the whole client experience automagically generated for you.
MVC is no more a tool for "good developers" than Forms is - rather its a good tool for developers that wish to achieve a particular result albeit one that comes with a price just as forms is also a good tool but with different outcomes because you're accepting a different set of compromises.
A good developer is one that can adapt - can learn the new techniques necessary to work on a different platform, to target new environments, to use appropriate solutions for a particular task and ultimately that can apply solid patterns and methodologies to their work in so far as is possible whatever the dev environment...
i also spend one year on mvc what i learn till now is u can rely on client side as much as u can but in classic asp.net most of time u used server side controls like gridview. In asp.net mvc u can replace it with jquery controls like jQgrid and jquery datatable. you must have to spend some time to learn asp.net mvc the it might looks u better then asp.net classic.
for reference read asp.net mvc pro book
MVC is not a new concept; in fact other languages have this kind of framework long before Microsoft got it. Think about Ruby On Rails, Zend Framework, Symfony etc.
If you say that MVC is for the hardcore and the alpha geeks, then by your logic other language developers are much more advanced than .Net developers. I don't think this is true.
Your problem with MVC stems from your webform background; ASP.Net and ASP.NET MVC greatly differ in terms of concepts and approach. So some unfamiliarity is expected for those who are moving from one framework into another. Me, on the other hand, who has no webform experience ( although I do have winform experience), don't find MVC hard to grasp.
And I don't think I am smarter than anyone else.
All i can suggest is that you need to do more of it! The more you practise, the more it will become clear. That's how it was for me. I was fundamentally stumped by the MVC concept to start with but after much frustration i just decided i would need to force myself to start using it or i'd never get it.
I'd recommend actually completing one or two of the tutorials found on the asp.net/mvc site from start to finish. I can personally recommend the NerdDinner (and the book from which this example was birthed - Pro ASP.NET MVC 1.0) and Storefront tutorials.
ASP.NET MVC is built on top of bunch of old concepts - HTTP, HTML, CSS, JavaScript. And so on. The whole point is to bring their power directly to your hands. If you can't handle this power - for example, you're not familiar with HTTP statelesness, or how to build rich pages with HTML/CSS/JS - you can't do much with ASP.NET MVC.
If you say that you're in programming for only one year then you're most probably not familiar with those concepts and that's the problem, not in the MVC itself.
Maybe you take ASP.NET MVC as a refinement of ASP.NET. That's wrong. They're VERY different. Imagine yourself doing web development with only HTML, CSS, and jQuery [1]... can you? If you can't then you will have troubles doing MVC.
I personally worked with ASP.NET for couple of years, and ASP.NET MVC was a breath of fresh air. It's just so much simpler and cleaner.
[1] This can be done, for example with data fed via web services.
MVC is great but the argument that it makes you happy by finally giving you the power of HTML, CSS and Javascript is real crap. The same logic would say: code in pure SQL and forget nHibernate or Linq. Why is abstraction bad? I like MVC but please don't use such arguments. MVC needs something to be able to build complex rich user interfaces (which are browser compatible).
Finally, on HTML, CSS and Javascript. The fact that MVC forces you to go back to the basics does in now way mean that the developers do it right. Whether you use web forms or MVC, a bad JS developer stays a bad JS developer (and same for HTML or CSS).
Sometimes it is better to not give too much power to the weaker developers in a team.

Safe to jump on ASP.NET MVC bandwagon when building enterprise solutions?

Before I get pointed to one of those 'VS.' questions like below...
ASP.NET webforms + ASP.NET Ajax versus ASP.NET MVC and Ajax framework freedom
Should I pursue ASP.NET WebForms or ASP.NET MVC
ASP.NET MVC Web application vs ASP.NET Web Application
... please let me state that I'm not looking for a comparison.
Some of my concerns that I need answers for include:
Is the learning curve for doing crazy UIs (e.g. having UI for building a BOM tree online) steep? Lots of people posting questions seem to be having problems with some UI requirement or another which has me worried. Is the technology mature enough to handle those type of requirements?
Is there a pretty well developed community and how available is online literature? You can get tons of literature for WebForms.
Would the time to develop it be comparable or less to building a traditional enterprise WebForms site?
How long would it take to get a whole team of developers comfortable (if not enamored) with WebForms to become well versed in ASP.NET MVC?
The truth of it I think is that StackOverflow is Google-like product and ASP.NET MVC might be great for that. But I'm stuck developing software in the Your company's app category.
alt text http://stuffthathappens.com/blog/wp-content/uploads/2008/03/simplicity.png
So taking a plunge could prove very costly later on if something can't be done or it has to be hacked. Hope to hear from those that have taken the plunge.
Thanks.
About 3 months ago, I was told that I needed to develop an enterprise web-app (well, a series of small web-apps actually), but that I could choose whatever technology I wanted.
Since I'm most comfortable with VS/C#/.Net, the dilemma was whether to choose ASP.NET WebForms or ASP.NET MVC2 -- Unlike you, my only background was with Windows Forms (WinForms) and a little WPF. So I had to research (and try-out) both WebForms and MVC.
Just like you, I realized that my app would be neither Google nor Apple like, but your bog standard company app with thousands of buttons and boxes, etc. WebForms seemed like it would be the fastest to deploy, but hard to test and hard to maintain on a long-term basis. MVC seemed to have a much steeper learning curve, but once established, testing and maintenance would be a breeze.
I only fiddled with WebForms for a week, so I can't really comment on it. But MVC is definitely everything I was expecting it to be.
Yes, it's a steep learning curve. Concepts that were new to me:
Model-View-Controller (MVC)
Separation of Concerns (SoC)
Model Binding
Unit Testing and Test Driven Design (TDD)
Mocking and Stubbing
Dependency Injection (DI)
The books that helped me the most were:
Pro ASP.NET MVC2 by Sanderson (MVC, Model Binding, DI, TDD)
The Art of Unit Testing by Osherove (TDD, Mocking, Stubbing, DI)
I also had to brush up on my HTML, CSS, and Javascript.
Overall, there seems to be a fair amount of ramp-up work in the beginning, but maintaining and extending the existing application has been pretty painless. Whenever I've been asked to make changes, it's been fairly easy and I've typically been able to deliver on-time or even sometimes ahead of schedule.
In an ideal world, writing an MVC app would happen with 2 people. One person writing the core code and a second person writing the UI and the Views (HTML, CSS, Javascript.) Although it's entirely possible to do it all by yourself. (which is what I'm doing right now...)
I have run into some hitches deploying in the Enterprise, though. Internally, my company is running Windows Server 2003 and IIS6. Unfortunately, we have been unable to get the app to deploy properly on IIS6 when using Virtual Pathing. (All the references to and in the CSS files are broken.) If you plan on deploying MVC, I would recommend using IIS7 or higher. MVC supposedly works on IIS6, but requires that your IT department be willing to figure out how to get it to work.
Edit: I just realized I never directly answered your questions. Here goes:
My personal experience has said, that, yes, the learning curve is steep for building good Models and UIs, but I'm not really a web-developer so I've been working with that handicap. The good news is that the MVC technology is pretty mature.
Yes, the community is pretty well developed and growing. You'll get a lot of good answers from StackOverflow as well as MS's ASP.NET MVC sub-forum.
I have no personal experience coding WebForms, but I have coded plenty of WinForms apps and I feel like it's taken me approx. 3 times longer to build this MVC app. The initial investment is a bear, but regular maintenance and improvements seem to come WAY faster, especially as the app has grown... Since you seem to have a team of programmers, it may come faster for you guys as you can probably split up the learning/workload.
Again, no prior experience with WebForms, but what I can tell you is that as I was learning ASP.NET MVC, there were times when I was struggling to understand what was going on because I had no prior ASP.NET background. (Example: Membership and Role Providers -- I had to code my own recently. Boy was that fun...) On the plus side, I didn't have any "old ways of doing things" (aka. WebForms) to unlearn either. If you have a team of folks enamored with PostBack / CodeBehind, you can bet that MVC is gonna seem awfully strange at first. But hopefully your team will see the advantages that MVC brings and embraces it fully.
Oh, and it should be noted that you can blend MVC and WebForms. It's not an all-or-nothing proposition. Although, if I were in your shoes, I'd try to embrace MVC as much as possible and only use WebForms where it clearly makes more sense.
Ok, I hope this helps... :-)
I can answer half of your question. I've just dove into MVC from a WebForms background. There is (obviously) a learning curve, but it's really not very steep. I've been able to make the transition with little effort, and I find the whole thing to be a breath of fresh air.
However, I am quite capable with front-end technologies (HTML & Javascript), and I don't like the HTML the WebForms and Microsoft ajax framework generates. If you and/or your team are like this, you will love it. However, if you are proud of the in-depth knowledge you have of the event hierarchy, or if you love the simplicity of UpdatePanels, then you'll probably bridle against the changes.
The documentation is OK, enough to get going happily, anyway. Here's a few videos to whet your appetite:
http://videos.visitmix.com/MIX09/T49F
http://videos.visitmix.com/MIX09/T50F
http://videos.visitmix.com/MIX09/T44F
Here's your documentation home:
http://www.asp.net/mvc/
For a bit more info, the first chapter of the asp.net mvc 1.0 book is online and can be downloaded for free. See ScottGu's blog here:
http://weblogs.asp.net/scottgu/archive/2009/03/10/free-asp-net-mvc-ebook-tutorial.aspx
And, the full code for the chapter can be found here:
http://www.codeplex.com/nerddinner
Finally, in terms of development time, I think it might take a bit longer to develop apps using MVC (although I have no evidence of this), but I think supporting, maintaining, bugfixing and enhancing will take a lot less time. So, with a small up-front investment, I think you'll more than recoup that effort.
Anyway, like I said, these are my preliminary findings. I still have yet to hit a really hairy problem.
As you know its all about the people first, technology 2nd. You can simply build out a new functionality of your company app because they can co-exist, then you can answer all those questions yourself.
It's new stuff so it will of course take more time than what you're used to but heck its all fun so jump right in and start answering these questions for your own people and app.
Interesting that your question focused all on your concerns and not on any benefits. Have you asked yourself the "why" question? If you feel you can be successful with WebForms, why change to MVC? What is there in MVC that justifies the risks? If you were paying for the project, what would you do?
I'm not pitching WebForms over MVC by any means, but as an architect, you need to be able to come back very strong to the question of why you decided to go away from a very well-known quantity to a relatively new one. I think that there are many good reasons to do so, but it not my job on the line. :)

Resources