चांगली क्लास मॉडेलिंग म्हणजे असे वर्ग जे वास्तविक डोमेन संकल्पनांच्या नकाशे आहेत, प्रत्येक एक स्पष्ट जिम्मेदारी असून, 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
