has a post to his site covering a method he’s worked up to solve the "widget" problem in ADR, the Action-Domain-Responder design pattern he worked on defining.

The “ ” is when you have several panels or content areas on an HTML page that have different sources. You might have a main content area, then a calendar off to the side, with perhaps a list of recent news items or blog posts, a todo or reminder widget, and maybe other information panels. The problem is that they each have different sources, and may not always be displayed in every circumstance — perhaps they are only shown to some based on their preferences, or under certain conditions.

So how, in Action-Domain-Responder, do we get the “right” data for the set of widgets that are actually going to be displayed?

His answer is pretty simple, basically that the requests are handled the same as everything else but with more kinds of data contained in the "domain" of the response. He walks through a code example of a site that would pull out the set of widgets to show and inject them into the "payload" for passing back to the responder for output handling.



Source link

LEAVE A REPLY

Please enter your comment!
Please enter your name here