# Primitive Obsession

> Using primitive types instead of small objects for simple tasks.

- **Category**: Code Smells
- **Subcategory**: Bloaters
- **Canonical URL**: https://designpattern.fyi/patterns/primitive-obsession/

---

## Description
'**Intent**: Identify when primitive types (strings, numbers) are used to represent domain concepts that should be objects.

**Context**: You're passing around primitive types like strings for phone numbers, email addresses, or money. Validation and behavior related to these concepts is scattered throughout the codebase.

**Solution**: Create small classes or objects to represent these domain concepts. Move validation and related behavior into these classes.'



## Use Cases
Use when primitives are used for domain concepts that have behavior or validation requirements.









---
**Reference**: [Original Source](https://refactoring.guru/smells/primitive-obsession)

