การสร้างแบบจำลองคลาสที่ดีหมายถึงคลาสที่แมปไปยังแนวคิดโดเมนที่แท้จริง โดยแต่ละคลาสมี ความรับผิดชอบเพียงอย่างเดียว เกี่ยวข้องกันผ่านความสัมพันธ์ is-a/has-a ที่สุจริต และพึ่งพา การสำรวจข้อมูล ที่ขอบเขต ไม่มีสูตร แต่มีกระบวนการที่สามารถทำซ้ำได้
กระบวนการที่ใช้ได้จริง
text
1. Find the NOUNS → candidate classes (Order, Customer, Payment)
2. Find the VERBS → candidate behaviors/methods (place, refund, ship)
3. Assign each behavior to the class that OWNS the data it needs (high cohesion)
4. Choose relationships: IS-A (rare, must pass LSP) vs HAS-A (default)
5. Depend on interfaces at boundaries (DIP); inject volatile dependencies
6. Keep invariants inside the object (encapsulation); prefer immutability for values
