Let the object answerintermediate
A switch on a type must be edited every time a type is added, and there is always more than one of them; asking the object instead means a type invented tomorrow works in code written today.
Gregorian rules are baked into Date and MonthDay, so a second calendar would mean editing both. Make the calendar an object that is passed in, add the Julian calendar, and run the same model under each.
An abstract Calendar injected into Date and MonthDay, no calendar rules left in either, two factories, and both calendars demonstrated.
Published in full, before you start — every point is one of these and there is nothing else.
A switch on a type must be edited every time a type is added, and there is always more than one of them; asking the object instead means a type invented tomorrow works in code written today.
A hierarchy puts every object in one position on one line, so the first person who needs abilities from two branches has nowhere to go and starts copying.
Anywhere the parent works the child must work too — and a subclass that compiles perfectly can still break the first caller who relied on something the parent quietly promised.