category : JavaScript

JavaScript Design Patterns: Facade

In our 4th installment of the JavaScript Design Patterns Series, we’ll be taking a look at the Facade pattern. Whether you know it or not, I can almost guarantee that you’ve used the Facade pattern if you’ve been programming in any language for more than a second (that might be a bit of a hyperbole, but you’ll forgive me, right?). You can define the Facade pattern as a piece of code that simplifies a more complex interface. You can pretty much call any form of abstraction a facade. Have you ever made a named function that had more than one line of code within it? Yup, that’s technically an example of the Facade pattern.

JavaScript Design Patterns: Composite

My last post was about the Bridge Design Pattern, which continued the JavaScript Design Patterns series that started off with the Singleton. Today we’ve moved onto the Composite Pattern. Composites are quite useful. By definition of the word “composite”, Composites are _composed _of multiple parts to create one whole entity.

JavaScript Design Patterns: Bridge

In my last blog post article I discussed the Singleton Design Pattern and how it is used in JavaScript. This time around the Bridge design pattern is poking its head up and asking for a bit of attention, making it the second in the JavaScript Design Patterns series. Every place I’ve read about the Bridge pattern likes to quote the Gang of Four directly in their description of what the Bridge pattern is, so I figure why not me too? The Bridge pattern should “decouple an abstraction from its implementation so that the two can vary independently.” Bridges are quite beneficial in event-driven applications, which are quite common in JavaScript. Considering that fact, it’s surprisingly one of the most underused design patterns.

JavaScript Design Patterns: Singleton

This is the first in what should be a pretty long series about JavaScript design patterns. In 1995, Erich Game, Richard Helm, Ralph Johnson and John Vlissides (known as the Gang of Four) published Design Patterns: Elements of Reusable Object-Oriented Software, a book cataloging recurring solutions to common dilemmas in software architecture and design. It also started a common vocabulary for referring to these solutions. If you’d like to know more you can find it on Wikipedia.

Securing JavaScript

The ProblemCross-site Scripting is a problem in the world of the internet. Someone hijacks your web site by injecting a little bit of JavaScript code and suddenly he/she has access to pretty much anything they want on your site. Douglas Crockford gave a talk at the end of March last year (at least, that’s when his video was published on YUI Theater) that partially discussed this problem, and this article is largely based off that talk. He noted the web’s vulnerabilities to these types of attacks, mostly due to standards that must be implemented by the browsers and having very little to do with bugs. He also felt, though, that JavaScript is one the best languages for creating secure code.

Infusionsoft Failure

Has anyone here ever used InfusionSoft? It’s an amazingly powerful piece of online software that brings together a lot of features dealing with email marketing, sales, tracking, statistics, and shopping carts. There’s tons to talk about and it’d take a couple year’s worth of blog posts to go through every feature and that would only happen after the year it takes me to learn InfusionSoft. This blog post is exclusively about the shopping cart feature and the headaches that come with it.

Let's Start This Off ($script.js)

This is my first blog post ever, which goes without saying that this is my first blog post on this blog. I figure I’ll start off strong with a new development in JavaScript. If you’ve gotten into JavaScript development and also tried enhancing performance on sites that use Javascript, you probably already know that when the browser downloads a JavaScript file, it is executed immediately. While JavaScript is being executed, the browser will stop downloading resources such as images and style sheets. This can be really painful on sites that use a large amount of JavaScript because it can seem to bring the browser to a halt.