Value Objects Practical Example - What is a Value Object? - Full PHP 8 Tutorial

preview_player
Показать описание
In this lesson, we learn about value objects (VO) with a practical example. We also cover the differences between the Entities, Value Objects & DTOs

SOME OF THE WAYS YOU CAN SUPPORT THE CHANNEL
👍 Smash the like button
🤝 Subscribe to the channel & turn the notifications on
💬 Post comments, any feedback is greatly appreciated
THANK YOU!

🛠️ TOOLS & SERVICES I USE

LESSON 3.24

RESOURCES

** Affiliate Disclaimer: Some of the above links may be affiliate links, which may generate me a sales commission at no additional cost to you.
Рекомендации по теме
Комментарии
Автор

After every lesson I feel lucky to be watching this wonderful course

mwaas
Автор

I am very thankful you make such quality videos. Please keep making more videos on concepts like these, these are very helpful. I really feel like learning a lot in short time watching your videos.

aryank
Автор

Bro, you are amazing, your php 8 course is incredible, thank you very much for this gem.

andersoncdz
Автор

You make great content. Thank You much. Your code style is highly elegant. I'm looking forward to form request, auth, authorization, middleware, and several most common patterns using in laravel

SerhiiDorn
Автор

19:18 This refactoring felt like the speed of light 🚀💪

benderbg
Автор

Thank you for the great content, Gio!

OlayDede
Автор

Thanks Sir 🙏, awesome content, it's cristal clear 👌

chlouis-girardot
Автор

Hi! there is an additional 'i' in entity ! Have enjoyed this course to the fullest, would use it as reference for years to come!!

manh
Автор

awesome and fantastic. I might gonna use this reference someday. Immutable and side effect free values makes ease by making it less prone to bugs, don't know yet when to use the equalTo method for checking equality. But I might figure it out someday, thanks

stephen.cabreros
Автор

Hi Gio, big thanks for these PHP tutorials. I have years of experience, but after these videos, I still learnt a lot and now much more confident.
Btw do you have any recommendations for similar types of videos for Javascript? I have watched Laracasts but looking for something different.

MayankJaniOfficial
Автор

Hi, , Thank you for a wonderful video & deep explanation about it.. It's really easy to understand..
May I know, what is the PHPStorm plugin that you using to make this sign '->', '===', etc pretty? I seen it in your another video..

mohdsyafiqjohar
Автор

do you plan on doing some videos on most common design patterns in php?

pusikurac
Автор

I'm really excited about how introducing ORM crippled Entitites into some data-db objects, so you need to introduce things like Value Objects to heal your improper object design. "Entities are normally identified with ID" - yes? Since when? Entity is normal object with properties and methods. Like any other object. Just using ORM made them so. Even senior developers are crippling the OOP by using ORM and then using external "services" to implement methods, which should be integral to object (entity). And then adding artificial IDs to every entity, so no one really understand the code nor DB structure, because is full of IDs you don't really need for anything (because you have composite keys, right?).

To conclude this: you don't need any VO here. Simply use your entities and set their properties by other entities, like dimension etc. Sure, you can make them immutable, by default, or by method. Then your object of PackageDimnension class is valid for whole module, even for another entity, like Pallet. Then pick your pre-set PriceCounter, feed it with Package object and it will set the price. Then just pass the object into some kind of mapper to store value, that's it.

IvanVlk
Автор

I suggest that you make Laravel course. Thank you

Abdulrahman-mytu
Автор

Hi Gio, I enjoyed this video. Learning further to simplify an application and make it easier to manage. But pls, why did we need to create the equalto() function? I didn't quite get that. Why do we need to compare the the other value object with the current value object? I understood the function, its the "why" I didn't get. Thanks a lot Gio.

Zubbee
Автор

Valuable lesson again, Gio, . Thank you.

In the code you kept the new enum, VO's and Service class together in a directory. Is that what you would normally do? I can see they are related and perhaps the only relevance for them is in that service, but you also created an enum directory in the app, so I wondered if there are rules in that you follow.

hansschuijff
Автор

Wow man! This is so so useful. Thank you so much! Please if you have time (and will), make a short series on DDD.

pasizdobrekuce
Автор

PHP design patterns stuff would be a nice addition if it's not already planned on the series. Very few resources on this on YT.

codingzen
Автор

Please also make a video on building middleware from scratch and its implementation without using any framework

rxxt-shvj
Автор

In my view, DTO should called as Data Transformation Object as i see it was only doing transformation and not transfer. This is very similar to what we do in Data Warehousing using ETLs. I may be wrong.

truthteachers