On Fri, 2012-07-13 at 04:35 -0700, Daniel Gonzalez wrote: > Hi, > > > We are considering integrating PyDispatcher with our pyjs application, > to keep the components (forms, tables, ...) loosely coupled. > The goal is that the different components can trigger events in all > other components which are interested. For example, a JSONRPC request > to the server can return data which must be displayed by different > components in different ways (a table will add a row to display it, a > VerticalLayout will update some of the internal components with the > data received, ...) > > > Several questions arise when considering this route: > * Has somebody experience with that? > * Are there any alternatives to achieve the same goal, maybe > pyjs native? > * Are there any up-front incompatibilities between pyjs and > PyDispatcher? PyDispatcher is pure python, but maybe the > architecture makes it incompatible with pyjs. > We are of course willing to report (and contribute if desired) any > progress that we may have by doing this integration, but before even > starting with it I would like to know what are your thoughts on this. > > Hi, Daniel
puremvc is a good alternative, and has pyjs examples (timesheet and employeeadmin that I've looked at, and examples/misc/gaedjangononrelpuremvcblog looks interesting, too!) Puremvc has wonky nomenclature, but it does the job well. It's a sort of event-oriented superstructure you overlay above the pyjs components. You can look up your data holders and component managers by name. You can send notifications out, and you can register listeners to react in turn. When your app is properly configured, the app's components do not know that data and user interactions are managed by puremvc, so components with the same api can be switched out at will. It's worth a look. http://puremvc.org If you find your brain turning to jello with the puremvc jargon, the puremvc examples can at least provide a template for experimenting with PyDispatcher. - Jim Washington