Design Patterns : “Supervising Controller” or ”Presentation Model”

When skinning a UI component, a developer is always faced with the option of using “Push” or “Pull” for getting data from the Component to the Skin.

Eventually the decision can be inferred from the way the Adobe Flex framework itself has been implemented in the upcoming release: Adobe Flex 4 – codename “Gumbo”.

Here transcribing from the documentation for skinning…

There are different ways to pass data back and forth between the skin and the component. One is the push method; the other is the pull method. The push method means taking a property from the component and stuffing it into the appropriate skin slot. On the other hand, if the skin asked the host component what the property value was, that would be the pull method. The pull method would use binding in the skin to grab the content from the component. In the push method, the component pushes the value down into the skin. For example, in FxContainer in the content setter, we push this value down to the contentGroup part. Though there’s no hard rule when choosing between the two different methods, in the framework, if the functionality is optional in the skin, we use the pull method. However, if the functionality is required in the skin, we use the push method.

It’s important to note that the Adobe Flex Gumbo team is deviating a bit on this topic from the formal definition given by Martin Fowler, where the Gumbo team have the decision following the line between elements being required or optional, Martin Fowler has the decision follow a complicated / not-complicated distinction… despite my great admiration for Martin Fowler and my strong preference for general solutions – I think I will attempt to mostly follow the Gumbo platform designers based on the perception that consistency is better than obtrusive idealism.

FYI… “Supervising Controller” is taken from the context of the “Supervising Presenter” as discussed here by Martin Fowler…


2 thoughts on “Design Patterns : “Supervising Controller” or ”Presentation Model”

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s