O'Reilly logo

JavaScript Domain-Driven Design by Philipp Fehre

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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/ ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required