Course Hive
Search

Welcome

Sign in or create your account

Continue with Google
or
Stop Passing Primitives Everywhere (Use Value Objects)
Play lesson

Software Design in Python - Stop Passing Primitives Everywhere (Use Value Objects)

4.0 (1)
31 learners

What you'll learn

This course includes

  • 31.5 hours of video
  • Certificate of completion
  • Access on mobile and TV

Summary

Keywords

Full Transcript

🧱 Build software that lasts. Join the Software Design Mastery waiting list → https://arjan.codes/mastery. In this video, I show how to use the Value Object pattern in Python to model prices, percentages, and email addresses properly. I’ll enforce invariants once, eliminate ambiguity (is 0.2 equal to 20%?), and make invalid states hard to represent, without adding unnecessary complexity. 🔥 GitHub Repository: https://git.arjan.codes/2026/value. 🎓 ArjanCodes Courses: https://www.arjancodes.com/courses. 💬 Join my Discord server: https://discord.arjan.codes. ⌨️ Keyboard I’m using: https://amzn.to/49YM97v. 🔖 Chapters: 0:00 Intro 1:44 Primitive Obsession (The Actual Problem) 2:30 The “Before” Example (Looks Fine, Isn’t) 3:10 What a Value Object Actually Is 3:47 Price as a Value Object (Behaves Like a Float) 5:39 Percentage as a Value Object (Kills Ambiguity) 7:27 Keep Business Logic as a Function 10:27 Second Example: EmailAddress as a Dataclass Value Object 12:03 Quick Mention: Pydantic 12:33 Why Enums Aren’t Value Objects 13:08 Final Thoughts #arjancodes #softwaredesign #python

Course Hive

Continue this lesson in the app

Install CourseHive on Android or iOS to keep learning while you move.

Related Courses

FAQs

Course Hive
Download CourseHive
Keep learning anywhere