Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying JavaScript Domain-Driven Design
  • Table Of Contents Toc
JavaScript Domain-Driven Design

JavaScript Domain-Driven Design

By : Philipp Fehre
3 (2)
close
close
JavaScript Domain-Driven Design

JavaScript Domain-Driven Design

3 (2)
By: Philipp Fehre

Overview of this book

If you are an experienced JavaScript developer who wants to improve the design of his or her applications, or find yourself in a situation to implement an application in an unfamiliar domain, this book is for you. Prior knowledge of JavaScript is required and prior experience with Node.js will also be helpful.
Table of Contents (10 chapters)
close
close
9
Index

Value objects

When dealing with objects in various languages, including JavaScript, objects are almost universally passed and compared by reference, which means that an object that is passed to a method does not get copied, but rather its pointer gets passed, and when two objects are compared, their pointers are compared. This is not how we think about objects and especially value objects, as we think of those as identical if their properties are identical. More importantly, we don't want to consider the inner implementation details when we consider things like equality. This has some implications for the function using the object; one important implication is that modifying the object will actually change it for everybody in the system, for example:

function iChangeThings(obj) {
  obj.thing = "changed"
}

obj = {}
obj.thing // => undefined
iChangeThings(obj)
obj.thing // => "changed"

Related to this is the fact that comparing does not always yield the expected...

CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
JavaScript Domain-Driven Design
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon