I use a Singleton-class to store "mostly static" application data, usually in properties of this class.
I load the data with a JSON-RPC call to the backend at application start or after login of the user. The data can be stored either in a config file or a database or whatever on the backend server. In addition to the (automatic) getter/setter methods for the properties I also have a refresh() method that can be called when I want to make sure that I have the most current infos from the backend. As the RPC-calls are asynchronous and the properties are actually updated by the RPC-handler, I use custom events in the class which are fired by the RPC-handler and can be listened to by whoever needs to know about an update. Cheers, Fritz On Thu, 8 Dec 2011, omrihar wrote: > Hi List, > > following the publication of the new Offline capabilities of Qooxdoo 1.6, I > have a "best practices" question: > > I have an application (Standalone) which relies heavily on a database > back-end which contains quite a lot of data which is used by my application > logic. Some of this data is mostly static and only changes occasionally. > The (inefficient) way I use it at the moment, is that whenever I need a > specific part of this data I call the server with a JSON-RPC call which > retrieves this data, which is later saved in a private variable or a > property of the specific application part (window / container / widget, > etc...) (depending if I need data binding or not). > > I am aware of the fact that I can simply use global variables (using the > window object) to share this data across my application but I didn't do it > yet, in part because it seems like a very inelegant solution, and in part > because it is an Intranet application with an expected user base of around > 20-30 people, so it is not very urgent for me to make it as optimized as > possible (yet). > > It seems to me that the Offline store is exactly suited for the purpose of > saving this kind of application data, and even perhaps sharing it between > different browser windows using the same application (e.g. when two users > are logged in through two windows). > So my questions are the following: > 1. Is it a good idea to store configuration data from the server (which > rarely changes) in an Offline store? > 2. If I understand it correctly, the difference between using "session" and > "local" storage is that "session" is only limited to one browser window > while "local" works also across browser windows/tabs. Is that true? > 3. It says in the store documentation that "You should use the environment > checks to make sure that the used storage technologie is supported by the > environment you want to run your code in." > How is this done? Would you mind adding a line doing it to the documentation > source code example? (I just noticed that the spelling of technology in the > documentation is still the German spelling of the word :) ) > > Thanks, > Omri > > -- > View this message in context: > http://qooxdoo.678.n2.nabble.com/Best-way-to-store-application-data-tp7074105p7074105.html > Sent from the qooxdoo mailing list archive at Nabble.com. > > ------------------------------------------------------------------------------ > Cloud Services Checklist: Pricing and Packaging Optimization > This white paper is intended to serve as a reference, checklist and point of > discussion for anyone considering optimizing the pricing and packaging model > of a cloud services business. Read Now! > http://www.accelacomm.com/jaw/sfnl/114/51491232/ > _______________________________________________ > qooxdoo-devel mailing list > [email protected] > https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel > > -- Oetiker+Partner AG tel: +41 62 775 9903 (direct) Fritz Zaucker +41 62 775 9900 (switch board) Aarweg 15 +41 79 675 0630 (mobile) CH-4600 Olten fax: +41 62 775 9905 Schweiz web: www.oetiker.ch ------------------------------------------------------------------------------ Cloud Services Checklist: Pricing and Packaging Optimization This white paper is intended to serve as a reference, checklist and point of discussion for anyone considering optimizing the pricing and packaging model of a cloud services business. Read Now! http://www.accelacomm.com/jaw/sfnl/114/51491232/ _______________________________________________ qooxdoo-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/qooxdoo-devel
