Re: Connection Mngr: How many callback objects should be used in an app?
> Each line might list a contacts name, another line the variousIf you have n number of buttons, but there are only two types -- edit
> locations of a given contact. Each of these has 2 buttons, an "edit"
> button (calls a function which replaces the contact's name on the
> screen with 2 text
> boxes for the first/last names) and an "update" button to send to the
> The problem I am finding is that because I have various buttons for
> editing/updating info, each of these calls a different function which
> then needs another callback object to deal with the server reponse.
and update -- it seems to me you could normalise the edit and update
functions. Can you provide an example code for a function called on
> I am starting to get over a dozen callback objects. Am I using thisIf you have a dozen disparate tasks within a persistent UI, this
> Y!CM in the wrong way?
doesn't seem to be out of bounds, but the task you've described
suggests perhaps a callback(or a few) can be shared to accomodate
> How many callback objects should one be using in a smallishIf the application is entirely within your purview, then probably not.
> application? And is it recommended to use what I have read are
> "namespaces" to avoid placing so many functions/callback objects in
> the global scope?
If there is any possibility of the application scaling up, reuse, or
other developers contributing to the project, then you might consider
aggregating the callbacks into some sort of "map"; or, namespace your
application with your callbacks under its scope.