tags:

views:

156

answers:

5

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.

+4  A: 

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

Craig
Thanks for the reply I'll check out the link. I really interested in figuring out the best way to start developing a new app and what the best practices are?
Jemes
The NerdDinner application is a fantastic way to get started. I'd recommend you go through the entire tutorial to get your feet wet on ASP.NET MVC, and then look into more advanced extensions like MvcContrib and xVal. Also, various frameworks for Dependency Injection (I prefer Ninject 2) go a long way toward wrapping your mind around what MVC is capable of.
Dusda
Thanks for the answers, looks like I’ll be having a look at nerd dinner and C# as my next step.I would still be interested to know how people start coding their projects using mvc?Whether they put data access and validation in the controllers to get started then separate the code into a repository or service layer class or build service layers first?
Jemes
Jemes, I generally create Model and Services projects up front and then try and put all the logic and validation in them from the start. It is a good idea to keep your controllers as thin as possible, they are just an intermediary between the View and domain logic, they should just have some plumbing code really.
Craig
A: 

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.

mdm20
+2  A: 

Id recommend jumping straight into the sharp architecture stuff.

http://www.sharparchitecture.net/

boz
I've only used VB and thought it would be easier to start with what I already know as I'm new to .net and mvc, but I have noticed that lots of help and tutorials and are all in C. Would it be worth switching now or later?
Jemes
Howdy, I started in VB also and although the change to c# was a little intense at first, it'll make life easier in the long run.Most tutorials you see and frameworks you'll use are all written in c# so Id certainly recommend you make the switch.
boz
Switch to C#, you will be using both in the long run.
Picflight
A: 

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.

griegs
A: 

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: http://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.

queen3