Reblogged: What should I learn to get started in .NET and web development?

[Note: I am reblogging this post which originally was posted to the LearningLine blog. Hope you all find it useful here as well]

I recently had a conversation with someone who is looking to make a fresh start and become a developer (coming from other IT positions).  The question they had was:

What should I learn to get started in .NET and web development?

Now this question was starting from a position of “I’d like to get started with .NET and the web. How do I do that?” So please hold your “No, choose Ruby (or NodeJS or … )” comments. That’s another blog post. :)

Here’s my advice along with a bunch of courses you can use to accomplish this efficiently and affordably. Continue reading

Why Choose NoSQL and Document Databases over RDBMS

Do you want to know the biggest single reason you should choose document databases over SQL Server, Oracle, or MySQL? Hint: It’s not performance or scalability.

Here is a short screencast which shows you the stark contrast in simplicity between an application using a relational database and one using a document database such as MongoDB, CouchDB, or RavenDB.

This is an excerpt from my upcoming online MongoDB course for DevelopMentor. You can take the first 1 1/2 hours for free here:

Early access: MongoDB and NoSQL for .NET developers

Cheers,
@mkennedy

Installing MongoDB on Windows and OS X

Ready to get started with NoSQL and MongoDB? Here are two 7-minute walkthroughs for installing MongoDB as a Windows service / OS X daemon.

These are both excerpts from my upcoming online MongoDB course for DevelopMentor. You can take the first 1 1/2 hours for free here:

Early access: MongoDB and NoSQL for .NET developers

Windows:

OS X:

Feedback welcome.

cheers
@mkennedy

A Roundup of MongoDB Management Tools

I’ve been working with MongoDB for a long time now. Back in the early days, there really were no management tools analogous to RDBMS tools (e.g. SQL Server Management Studio). Since then, things have changed significantly. It’s time to look around and see what management / monitoring tooling is around these days for MongoDB.

The news is good. There are many different options to choose depending on your platform and use-cases.

1. Robomongo, price: $0 / open-source, platforms: Windows, OS X, Linux
http://robomongo.org/

Robomongo — is a shell-centric cross-platform open source MongoDB management tool (i.e. Admin GUI). Robomongo embeds the same JavaScript engine that powers MongoDB’s mongo shell. Everything you can write in mongo shell — you can write in Robomongo!

Robomongo

Key features: Continue reading

Optimistic concurrency in MongoDB using .NET and C#

[Update: Available via NuGet - MongoDB.Kennedy.Concurrency]

This article demonstrates a technique and supporting library for adding optimistic concurrency control to NoSQL databases and MongoDB in particular.

Watch a video walk-through using this library:

Quickly, what is optimistic concurrency control?

Ideally, all databases that allow concurrent access or disconnected access need to implement some form of concurrency control. This usually comes in two flavors:

  1. Pessimistic concurrency control
  2. Optimistic concurrency control

Pessimistic concurrency control is usually used when working heavily within transactions. That may be fine for bank transfers, but it typically falls down in the face of disconnected models used by almost all ORMs such as Entity Framework. Moreover, it is entirely inappropriate for NoSQL databases.

Frameworks such as Entity Framework have optimistic concurrency control built in (although it may be turned off). It’s instructive to quickly see how it works. Basically there are three steps:

  1. Get an entity from the DB and disconnect.
  2. Edit in memory.
  3. Update the db with changes using a special update clause. Something like: “Update this row WHERE the current values are same as original values”.

If that update returns “0 rows modified” then we know it was changed since we loaded it and are about to overwrite someone’s changes. This results in a concurrency exception and not changes go through.

Optimistic concurrency control for MongoDB

By carefully constructing update commands in C# with the official 10gen C# driver, we can achieve almost exactly the same flow. At the end of this article is a simple C# class (data context) which has save and delete methods which internally are safe via optimistic concurrency control. Continue reading

Take the first hour of any online developer course for free at LearningLine

[Note: reblogged from blog.learninglineapp.com. I'd like to personally invite you to check out our work over at LearningLine - just follow the links below.]

We believe that LearningLine is the most effective online training for developers, period. Today it gets even better. We are announcing the ability to preview any of our online courses, for free without entering any payment information.

This is not a trial that becomes a subscription or a silly 5 minute preview like other company’s offer.  You can now study approximately the first hour of any one of our courses. And you can spend as much time as you like doing so.

To get started, just head over to our schedule page, click on any course title you’d like and choose “Preview course for free“:

   preview-online-developer-course-for-free

This means there is now lot of content available to you right now. At a typical student speed working for an hour a day, it would take over a month to complete all the content that is available for preview. Continue reading

Slides and demos from DevWeek 2013

[Update: I added the downloads for the demo code on March 12th.]

I had a great time discussing these topics with everyone at DevWeek 2013. Thanks to all who attended my sessions. Here are the slides:

Getting Serious About The Cloud For Developers
Slides: Getting serious about the Cloud (DevWeek).pdf
Demos: CloudDriverS3SecureFiles-Demo-DevWeek-Kennedy.zip

18 Ways Your Brand-New MVC Web Application Can Be Better
Slides:More Ways MVC Better (DevWeek) – Kennedy.pdf
Demos: 18WaysMvcNewProjectBetterDemo-DevWeek-Kennedy.zip

Building Rich Forms in ASP.NET MVC (important - see note below)
Slides: Rich Forms with ASP.NET MVC (DevWeek).pdf
Demos: Rich-ASPNET-Forms-Demos-Michael-Kennedy.zip

Applied NoSQL in .NET (important – see note below)
Slides: Applied NoSQL in .NET (DevWeek).pdf
Demos: Applied-NoSQL-in-dotNET-Demos-Michael-Kennedy.zip

Important note: In order to run this demo, you must download MongoDB and start it on your local machine. You do not need to initialize a database or anything like that but the db will be empty so use the admin feature to create categories and books. Running MongoDB as a Windows Service is not required.

Cheers,
@mkennedy

Announcing LearningLine: Instructor-led online training from DevelopMentor

I am very proud to announce an exciting new online learning platform from DevelopMentor:


http://www.learninglineapp.com

At DevelopMentor we have been thinking deeply about online training. We wanted to create an environment that combines the best parts of online learning and classroom training, the best parts of self-directed exploration and expert-led mentoring. We believe we have created just such an environment and I am thrilled to publicly announce it today.

Here’s a short 2-minute video which will give you a quick overview. You can get more details at http://www.learninglineapp.com.

Online training today

There are many shortcomings in how developers learn online today. Continue reading

3 Open-Source Validation Projects for ASP.NET MVC

The goal of this post is to show you validation options beyond those that come in-the-box from Microsoft and the ASP.NET team.

Currently, there are nine pre-built validation attributes that come with MVC:

hierarchy

While these are very helpful, knowing where to look to find additional validation options is super helpful. For example, what if the State property is only supposed to be required if Country property is set to USA? Good luck with that one! Continue reading

Screencast – Validating ASP.NET MVC Forms with DataAnnotations

Here’s a new screencast for you MVC guys and gals out there.

Validating ASP.NET MVC Forms with DataAnnotations

In this short screencast, I will show you how to leverage ASP.NET MVC’s excellent model binding as well as the DataAnnotations attributes to easily add both server-side and client-side validation for MVC websites.

Tips for optional parameters to ASP.NET MVC action methods

Here’s a quick ASP.NET MVC tip to help you be more productive and write cleaner code. We will see how to leverage C# 4′s optional and default parameters in our action methods for greatly simplifying our code while keeping it fully functional and error free.

Often you want to pass data to your controllers based on URL parameters. This can either be part of the URL itself in the case of route data or it can be part of the query string. In fact, this tip even works for input forms.

Let’s take a basic method which shows some census data, potentially filtered and sorted if that information is passed along, otherwise we’ll just show everything with a default sort.

value-types Continue reading

Use NuGet package restore to simplify code sharing

Here’s a quick post on how and why you want to consider using NuGet package restore.

First, if you’re unfamiliar with NuGet, it’s basically “add reference” to external software projects (typically open source ones such as jQuery, but also for Microsoft ones such as Entity Framework). You definitely need to check out David Ebbo’s post introducing it. NuGet will change the way you develop.

Now when using NuGet it maintains a packages folder near your solution file. For things like ASP.NET MVC that heavily leverage NuGet, you’ll see this folder is very large. It’s usually much larger than your project itself in the beginning.

If you write small projects and share them out as compressed files (e.g. zip’s), and size matters to you, you might want to consider enabling NuGet package restore (off by default) for those projects and delete the packages folder before zipping and sending it out.

As an example, with a typical MVC 4 project, the “raw” content is 680 KB. After doing a build and counting the packages folder you’ll see it jumps to 16.9 MB. If that helps you significantly, then it’s probably a good idea to use package restore.

Three things have to happen to use NuGet package restore. Continue reading

Attend my sessions at DevWeek 2013 in London

Want to see some of the topics covered in my blog presented live and in-person? Make your way to London in March 2013 to DevWeek! I’ll be presenting 4 sessions covering NoSQL, ASP.NET MVC, and Cloud (Auzre and AWS mostly). Details below.

Continue reading

Introduction to ASP.NET MVC Routes

Here’s another screencast, this time on MVC and routing.

In this short screencast, I’ll show you everything you need to know to get started with ASP.NET MVC routing. You’ll see how default routes in MVC map to controllers and actions. Next you’ll see how to map additional data from query-strings in addition to simple route data. Finally, we’ll create a custom route to pass additional data in a clean, URL based manor.

Create new ASP.NET MVC views the easy way

As an instructor at DevelopMentor, I have the unique opportunity to watch many developers experience ASP.NET MVC for the first time. This typically goes through several stages:

  1. Extreme Interest (the web is exciting again!)
  2. Confusion (where does the view go again? wait, what’s routing?)
  3. Shock (you have got to be kidding, forearch in the html file?)
  4. Loss (surely there are some drag-and-drop controls, right… right?)
  5. Acceptance (OK, I will learn HTML and CSS after 10 years of working on the web)
  6. Joy and Freedom (How could I have ever used webforms?)

I rarely hear developers who’ve adopted MVC returning to webforms voluntarily. But not everyone makes it to level 6 of MVC enlightenment. So here is an article to help the new comers make it across step 2 more easily as well as help the advanced MVC developers be more productive. Continue reading