Objects first

When building the dungeon manager, we set out to create a maintainable and evolvable piece of software. The core principles of OOP are there to help us out when dealing with objects, but JavaScript is special when it comes to object orientation.

As many JavaScript programmers will most certainly have heard, JavaScript uses prototypical inheritance and, more importantly, has not really got a concept of classes, only instances.

Tip

Even though the next version of JavaScript, ECMAScript 6, introduces the class keyword, the core language design does not change. Classes are really just syntactic sugar over the prototypical inheritance present in JavaScript right now. If you want to know more about ES6, follow the blog http://www.2ality.com/ ...

Get JavaScript Domain-Driven Design now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.