If I have case classes with allot of properties in common, should I use inheritance?

Viewed 50

I am a order management system that has models that have many fields that are common amongst the classes.

ProductType1(p1: String, p2: String, p3: String, ....)
ProductType2(p1: String, p2: String, p3: String, ....)
ProductType3(p1: String, p2: String, p3: String, ....)

where p1, p2, p3 are common and then there are properties that are unique to each case class.

Is the best practise to use inheritance or just duplicate the properties?

0 Answers
Related