The task is to use the pattern. The task sounds like this. Determine the specification of classes for modeling user GUI objects (windows, buttons, text fields). Implement a reaction mechanism to events in any element. Ie, as I understand it, you need to use a pattern that will catch, for example, pressing a button and transmit information about what has been done. Choose between Observer and Mediator. I think that the Observer but the problem is that then it turns out 3 subtexts and one observer, but the meaning of the pattern in one subject and several observers, or am I mistaken? What can you advise?
- One observer will be only with the same type of behavior of all three "subjects". Otherwise, there will be several observers, one for each of the “subjects” of the observation. - ߊߚߤߘ
- Composite + Observer. Read about how this is done in DOM - Dmitriy Simushev
|