Design a DVD market place work. The DVD market place provides DVD to its clients with three categories: children, normal and new. A DVD is new during some weeks, and after change category. The DVD price depends on the category. It is probable that the system evolves in order to take into account the horror category.
Thanks to the inheritance links, we are able to distinct the DVD to its states. In these case, the addition of a new state does not imply code modification.
The category is a subclass of DVD imposing instances destruction to change of category. The question of the validity of this solution is open in regard of the proposed exercise. However, we have considered this solution valid in using a prototype creational pattern with a category as parameter.
The DVD class manages its state thanks to an enumeration. In doing so, the solution imposes a ``switch'' statement, and so, the category changing is possible. The problem of this solution concerns the extensibility. Indeed, if a new category is added, the DVD class must be modified to manage the new type.