974472 wrote:Or you could have EnglishNumber, FrenchNumber classes...
I'm not comfortable about this design. Maybe I should have a class Number, or Date, or Time? with methods to_words().
But that would mean inside each object I would have if language = ENG.. then..
How would you design your classes? Which pattern works best with this scenario?Well, as this is a completely synthetic example it's hard to say. Your interface version would definitely be simpler. The abstract factory pattern could be used to create "EnglishNumber/EnglishTime" etc. classes.