Asp.Net MVC - New Project How to Begin? - asp.net-mvc

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.

Related

What's a good tutorial for developing professional MVC applications with ASP.NET?

I am hoping this doesn't get flagged as subjective since everyone's idea of "good" can be different. However, I know that you know what I mean, so, instead of flagging this question, feel free to edit the subject if you think it could be presented in a more objective manner. This is also not a duplicate of a good tutorial for .Net development with MVC, spring.net and NHibernate.
I come from WebForms and need to learn MVC. I came upon this tutorial on MSDN which has been great for understanding the basics of the MVC design pattern. However, it's just enough to teach someone the bare minimum so that they have everything they need to know to build a rudimentary ASP.NET MVC application. From what I've seen, the methods illustrated there aren't exactly what I'd put in a professional, enterprise solution which is exactly what I am about to start working on. I'd like to jump straight from the basics to advanced development, so I am interested in a tutorial/guide that has achieved popularity for being a solid resource for MVC development and best practices.
I realize that this question could have multiple answers, only one of which can be selected. However, there's still the upvote system, so answerers can still get points and the upvotes will still serve as indicators for helpful answers which is really what SE is all about.
I think a good starting point, it would be to check the www.asp.net site. it's certainly a good place to start. There would you find many tutorials for your purpose.
Furthermore, if you are about to buy a book, check PRO ASP.NET MVC 4 by Adam Freeman, http://www.amazon.com/Pro-ASP-NET-MVC-Adam-Freeman/dp/1430242361/ref=sr_1_1?ie=UTF8&qid=1387461608&sr=8-1&keywords=Pro+ASP.NET+MVC.
It's really a masterpiece.
It's been a while since I've looked at it, but NerdDinner helped me out when I was getting started -
http://nerddinner.codeplex.com/
http://nerddinner.com/
I'd like to jump straight from the basics to advanced development, so I am interested in a tutorial/guide that has achieved popularity for being a solid resource for MVC development and best practices.
In my opinion, using a framework in enterprise level requires deep knowledge of every part of it. why a component/class is designed, what is the purpose of it, how do we use it, what's the best practice, etc.
In this way I have found the Programming Microsoft ASP.NET MVC by Dino Esposito very helpful. The book's aim is to explain the mechanics of the framework and effective ways to use it.

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

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

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.

Oxite or S#arp Architecture for new Asp.net CMS site

I'd like to build a CMS site based on Asp.Net Mvc and I want to choose my starting point.
I have seen that there is a lot of interest in the new Microsoft Oxite project also if it seems to be pretty early to adopt it in a production project.
I've also looked at S#arp Architecture but it does not properly compare to Oxite as is just a starting point for general Asp.Net Mvc sites.
For me S#arp Architecture has some advantages over Oxite as is far less complex and it uses Nhibernate for the data access layer.
Oxite code uses Linq2Sql for it's DAL and has already a project in the solution that requires the DB version for VS2008.
Oxite seems to me more blog oriented than CMS oriented but I haven’t looked the code deeply.
Here are some of the choices that would point me to S#arp Ar. for starting.
Simple clean architecture
Nhibernate Dal
Community supported
Oxite:
Microsoft project
Potential huge community
Early stages but very good code quality
Provider model that permits to easily switch the DAL
If anyone has looked at the code of these two projects please advice on your opinions.
Thanks
Oxite might be feature rich, but the code quality is very low.
I was very surprised when I checkout the code and found controller actions with 100+ lines of very unclean code, tagsoup views, no unit tests, etc.
The criticism has been well summed up in these blog posts:
http://blog.wekeroad.com/blog/some-thoughts-on-oxite/
http://codebetter.com/blogs/karlseguin/archive/2008/12/15/oxite-oh-dear-lord-why.aspx
As always, it depends on your needs. It sounds like you need something more CMS based. Oxite happens to have some CMS-like features, but it's not really a CMS. It might be in the future as it's a community project, but right now it isn't (all you can do is add content pages).
We're glad everyone seems to like Oxite overall, but it is pretty early. Not to deter anyone from using it in production, because we do. We run MIX Online on it, but totally understand if you're not comfortable with it. We need a stabilization period. At the same time we also need people running it so we can make it stable. Chicken and Egg I'd say. :)
I didn't get much of a response at my question about Oxite here at SO (found at Oxite: What are you going to do with it?), but it is really new so it'll take some time for people to warm up to it and fully check it out. The architecture of Oxite is really easy to get started with; that's its strongest suit.
I'd never heard of S#arp before I read your question so I'll definitely check it out.
Oxite is well detailed already, entirely negatively.
I'll just add that I've been using S#arp architecture for several months and found it very maintainable and flexible. There's also a very solid, growing and active community of users around it.
It is very clean, and quite easily upgraded to Fluent NHibernate RC 1.0

Resources