Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Events
Videos
Audiobooks
Packt Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
JavaScript Domain-Driven Design

You're reading from   JavaScript Domain-Driven Design Speed up your application development by leveraging the patterns of domain-driven design

Arrow left icon
Product type Paperback
Published in Jul 2015
Publisher
ISBN-13 9781784394325
Length 206 pages
Edition 1st Edition
Languages
Arrow right icon
Author (1):
Arrow left icon
Philipp Fehre Philipp Fehre
Author Profile Icon Philipp Fehre
Philipp Fehre
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. A Typical JavaScript Project FREE CHAPTER 2. Finding the Core Problem 3. Setting Up a Project for Domain-driven Design 4. Modeling the Actors 5. Classification and Implementation 6. Context Map – The Big Picture 7. It's Not All Domain-driven Design 8. Seeing It All Come Together 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...

lock icon The rest of the chapter is locked
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
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime
Modal Close icon
Modal Close icon