/design-patterns

This project was created at Plovdiv University during lectures.

Primary LanguageJava

design-patterns

This project was created at Plovdiv University during lectures.
Over time, Santa became more and more tired and one day decided to optimize the work in his workshop. He gathered his three most trusted dwarves and introduced them to the new work process. The process and way of working that Santa described was as follows:

Only two types of toys would be produced in the workshop: "Doll" and "Wheel". In order not to go to the dwarves every day, Santa bought a magic board on which to write which of the two toys he needed, and the dwarves would follow the board and when they saw the written toy, each dwarf would take the toy from the workshop. . To control the magic board, Santa had to say the magic words "I need dolls" and "I need wheels" and immediately the board would say "Doll" or "Wheel".

Describe programmatically the new process of working in the workshop. To do this, use the templates Singleton (Santa Claus can be only one), Command, Observer, Abstract factory or Factory method. Places: Santa Claus, Magic board, I need dolls, I need wheels, Dwarf, Workshop, Doll, Bicycle Some of the conditions are for free interpretation. For example, you can decide for yourself what will happen to the manufactured toys, but the use of templates is mandatory. You have the freedom to make different types of dolls and wheels with matching factories or to add decorators for toys.