Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Domain-Driven Design in PHP

You're reading from   Domain-Driven Design in PHP A Highly Practical Guide

Arrow left icon
Product type Paperback
Published in Jun 2017
Publisher
ISBN-13 9781787284944
Length 394 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (3):
Arrow left icon
Keyvan Akbary Keyvan Akbary
Author Profile Icon Keyvan Akbary
Keyvan Akbary
Carlos Buenosvinos Carlos Buenosvinos
Author Profile Icon Carlos Buenosvinos
Carlos Buenosvinos
Christian Soronellas Christian Soronellas
Author Profile Icon Christian Soronellas
Christian Soronellas
Arrow right icon
View More author details
Toc

Table of Contents (16) Chapters Close

Preface 1. Getting Started with Domain-Driven Design FREE CHAPTER 2. Architectural Styles 3. Value Objects 4. Entities 5. Services 6. Domain-Events 7. Modules 8. Aggregates 9. Factories 10. Repositories 11. Application 12. Integrating Bounded Contexts 13. Hexagonal Architecture with PHP 14. Bibliography
15. The End

Value Object vs. Entity

Consider the following examples from Wikipedia, in order to better understand the difference between Value Objects and Entities:

  • Value Object: When people exchange dollar bills, they generally do not distinguish between each unique bill; they only are concerned about the face value of the dollar bill. In this context, dollar bills are Value Objects. However, the Federal Reserve may be concerned about each unique bill; in this context each bill would be an entity.
  • Entity: Most airlines distinguish each seat uniquely on every flight. Each seat is an entity in this context. However, Southwest Airlines, EasyJet and Ryanair do not distinguish between every seat; all seats are the same. In this context, a seat is actually a Value Object.
Exercise
Think about the concept of an address (street, number, zip code, and so on). What is a possible context where an address could be modeled as an Entity...
lock icon The rest of the chapter is locked
Visually different images
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.
Domain-Driven Design in PHP
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 ₹800/month. Cancel anytime
Modal Close icon
Modal Close icon