Loading ...
Sorry, an error occurred while loading the content.

History: My modules are hierarchical, but callbacks are orthogonal.

Expand Messages
  • onionesque
    I need to store several variables pertaining to the current state. In particular, they d represent current category of interest; current tab within that
    Message 1 of 1 , Mar 31, 2007
    View Source
    • 0 Attachment
      I need to store several variables pertaining to the current state. In particular, they'd represent "current category of interest; current tab within that category; current page within that tab; current selection". The cleanest and most user-parseable representation of that would be

        #
      category=123&tab=secondtab&page=1&selection=42

      but I can't go about registering "category", "tab", and "page" as modules, since the order of callbacks is undefined, and I really need to know all of them at once in order to render the view.

      Of course, I can devise my own scheme for representing the hierarchy, such as

       
      #category=123/tab=secondtab/page=1/selection=42

      but it would be a shame to lose the ready-made semantics we have in the other syntax.

      In my opinion, it wouldn't be too difficult to support a mode of operation that, instead of looping through the various modules and calling discrete callbacks (which works for orthogonal state), you'd collate the various state variables into an object and send it all at once to a single callback.

      What do you think?
    Your message has been successfully submitted and would be delivered to recipients shortly.