The Military Design Pattern
Let's say that you want to hide all your UI elements that inherits from a Hideable interface/baseclass.
This pattern enable you to go from code like this:
foreach (Hideable hideable in frame
.GetWidgetsManager()
.GetAllWidgets())
{
hideable.Hide();
}
foreach (Hideable hideable in frame
.GetPopupNotices())
{
hideable.Hide();
}
To this:
Hideable.Hide();
I have written an article about this that explains in further detail with implementation in C#.
Written by Alexander Brevig
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Java
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#