Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

6
  • I don't think it's Strategy. The Strategy pattern is about varying behaviour by swapping implementations at runtime. Stick in a ThingA, and your system runs in Mode A. Swap it for a ThingB, and it runs in Mode B. Etc. Commented Sep 10, 2018 at 0:01
  • I'm assuming his ControlContainerForm runs differently depending on what control container it contains. Commented Sep 10, 2018 at 0:02
  • The ControlContainerForm is just the place the objects ultimately get used; it's only mentioned for demonstration. The pattern is the idea of having IContainers, where you have the inner type (Control) which is being modified by the outer types (Containers). The containers pass the controls around, modifying them in their own ways. Someone mentioned Decorator, but I don't know if it's quite the same; it could be a variant of Decorator. Commented Sep 10, 2018 at 0:05
  • It's not Decorator because a decorator IContainer would be the sole owner of the IContainer that is passed into it. It looks like all your idea does is allow multiple different IContainer's to modify a Thing. Thus breaking encapsulation. Maybe the Object Orgy anti-pattern. Commented Sep 10, 2018 at 0:17
  • It doesn't "break encapsulation" just because it passes one object along. Each class has its own internals respective to its own role in the modification process. Commented Sep 10, 2018 at 0:34