Reputation: 17724
[Sorry for the title, I really didn't find a good one, if anyone has an idea, please edit, thanks!]
Hello,
I'm looking for a pattern / best practice for the following situation (just an example).
Imagine an editor for rectangles (just e.g. adding, resizing, removing rectangles). All rectangles shall have the same color, however this general color shall be changeable. The rectangle color shall be set using the editor class, something like
editor.RectangleColor = Red
The color shall however not be changeable directly on the rectangles, because this would probably allow an individual color for every rectangle.
What's the best way to realize this? Thanks in advance for any hint!
Upvotes: 0
Views: 105
Reputation: 43217
I think Observer pattern
should help in this situation.
Upvotes: 1