Backbone MVC Basics

Often, in today’s world, customers and client expect high performing, single-page applications. Backbone is one tool that provides a structure necessary for creating these applications. Backbone is a popular Javascript Application architecture library which provides classes and methods on the instanced objects which help you write more organized client-side applications. MVC Backbone helps give your application an MVC architecture. This is a design pattern that keeps your code more modular through separation of concerns. It keeps your business data in Models away from your user interfaces in Views. A third piece, the Controller, coordinates the passing of information from one...…

read more...

A Tour of Inheritance Patterns in Javascript: Part 4

Pseudo-classical instancing in JavaScript is extremely commonplace in the industry. Most browsers have optimized for this classing technique, and so most developers depend on it without investigating the other options, as we’ve discussed in the previous installments. This pattern emulates the syntactic sugar of many other class-based languages. It does not, however, behave the same way as other languages’ classing. It uses the exact same constructs as the prototypal inheritance with some strange plot twists. Pseudo-classical Classes We left off last time with the following code snippet creating restaurant instances for us: var Restaurant = function(address) { var instanceObj =...…

read more...

A Tour of Inheritance Patterns in Javascript: Part 3

Prototypal classing is one of the most underutilized methods of classing in JavaScript. It’s not well understood compared to its older pseudoclassical brother. The irony is that pseudo-classical classing really employs prototypal classing behind the scenes. That’s how flexible the prototypal inheritance pattern is, it can easily mimic a better known pattern. But, I’m getting ahead of myself (we’ll discuss pseudoclassical next time).

read more...

A Tour of Inheritance Patterns in Javascript: Part 2

Continuing where I left off last time, JavaScript has many different ways to create classes and instances of those classes. Today we’ll examing functional-shared in more detail. But why would we use functional-shared over functional? Functional-shared classes help us use less memory by sharing the same methods across many instances of our class. The functional style gives each instance it’s own properties, copying them into every single new instance. We would prefer to have each of our new instances share a reference to one definition of the methods available to our functions. Functional-Shared Classes Again, many engineers would argue that...…

read more...

A Tour of Inheritance Patterns in Javascript: Part 1

I have encountered many people who believe that because Javascript has lacked a true blueprint-creating, property-copying class primitive, that it is underpowered in the inheritance department. This is simply untrue. Flexibility is the name of the game in JS. It gives you not one or two ways to share methods and properties, but four!

read more...