WebMatrix and node.js: The easiest way to get started with node on Windows

Tomasz Janczuk and Steve Sanderson are having entirely too much fun. I posted just two weeks ago on Installing and Running node.js applications within IIS on Windows – Are you mad? when Tomasz and the team got node.js running rather nicely under IIS. Now they’ve got a nice little development environment in WebMatrix.

 

Continue reading

Installing and Running node.js applications within IIS on Windows ?

First, what’s node.js?

If you’re not familiar with node.js, it’s a new web programming toolkit that everyone’s talking about. It’s the one that makes you feel not hip if you don’t know what it is. Like Ruby on Rails was a few years back. Folks called it “Node” and it’s basically server-side JavaScript. The idea is that if you are doing a bunch of JavaScript on the client and you do JavaScript all day, why not do some JavaScript on the server also. One less thing to learn, I suppose.

If you are an ASP.NET programmer, you can think of node.js as being like an IHttpHandler written in JavaScript. For now, it’s pretty low-level. It’s NOT an HttpHandler, but I’m using an analogy here, OK? Here’s a lovely article by Brett McLaughlin that goes into more detail about Node.js and what it is. His subtitle is “Node isn’t always the solution, but it does solve some important problems” and that’s just exactly it.

 

Continue reading

Introduction to npm

This was the third in a series of posts leading up to Node.js Knockout on how to use node.js.

npm is a NodeJS package manager. As its name would imply, you can use it to install node programs. Also, if you use it in development, it makes it easier to specify and link dependencies.

Installing npm

First of all, install NodeJS. Like so much of the NodeJS ecosystem, npm is very young, so you’ll generally have to use a very recent version of node in order to use it. At the time of writing this, that means at least version 0.1.103.

To install npm in one command, you can do this:

curl http://npmjs.org/install.sh | sh 

Continue reading

Exploring the Observer Design Pattern

Introduction

During the course of a given development project, it is not uncommon to use the concept of design patterns to address certain problems relating to application design and architecture. However, the definition of design patterns is often difficult to convey with any level of accuracy; as such, the concept warrants a brief examination of origin and history.

The origin of software design patterns is attributed to the work of Christopher Alexander. As a building architect, Alexander noted the presence of common problems and related solutions within a given context. A design pattern, as Alexander termed this problem/solution/context triad, enabled an architect to rapidly address issues in a uniform manner during building design. First published twenty-five years ago, A Pattern Language: Towns, Buildings, Construction (Alexander et al, Oxford University Press, 1977) introduced over 250 architectural design patterns and provided the basis for the inclusion of this concept into the realm of software development.

In 1995, the software industry was first widely introduced to the design patterns as they directly related to building applications. The four authors, Gamma, Helm, Johnson, and Vlissides (collectively known as the Gang of Four, or GoF), intersected Alexander’s design patterns with the burgeoning object-oriented software movement in their work, Design Patterns: Elements of Reusable Object-Oriented Software (Addison-Wesley Pub Co, 1995). Based on their collective experience and examination of existing object frameworks, the GoF provided 23 design patterns that examined common problems and solutions encountered while designing and architecting applications. Following that publication, the concept of design patterns has grown to encompass many problems and solutions encountered in the software domain. In fact, the popularity of design patterns has given rise to the concept of anti-patterns, which are solutions that commonly worsen, rather than solve, the problem at hand.

Why Design Patterns?

Although not a magic bullet (if such a thing exists), design patterns are an extremely powerful tool for a developer or architect actively engaged in any development project. Design patterns ensure that common problems are addressed via well-known and accepted solutions. The fundamental strength of patterns rests with the fact that most problems have likely been encountered and solved by other individuals or development teams. As such, patterns provide a mechanism to share workable solutions between developers and organizations. Regardless of where these patterns find their genesis, patterns leverage this collective knowledge and experience. This ensures that correct code is developed more rapidly and reduces the chance that a mistake will occur in design or implementation. In addition, design patterns offer common semantics between members of an engineering team. As anyone who has been involved in a large-scale development project knows, having a common set of design terms and principles is critical to the successful completion of the project. Best of all, design patterns—if used judicially—can free up your time.

 

Continue reading