Latest Powerbuilder Tip
PFC Services
All pfc services are activated using an object function on the object on which the service works (the requestor object). The "connection" from the requestor object to the service object is an instance variable on the requestor object, that contains a reference to the service.
This means, that for each possible service on an object, such a function and matching instance variable must be coded.
In the case where you have many different services of a similar nature, this is not practical. This article outlines a method of avoiding redoing that code, while taking advantage of any similarities between the services in question. This is illustrated with code examples from an atual implementation. The example used is a business rules datawindow service
Table maintenance
Another issue with caching is table maintenance. If you link your datawindow with the cache and allow the users to modify that data, what happens if they decide not to save any changes? Not very nice.
So an option is not to share your table maintenance with the cache. Instead, load your data directly from the database. Then, after every save, refresh you cache. Here's what we do:
// make sure that the cached version is refreshed appropriately.
gnv_App.inv_dwCache.of_Refresh(is_cached_dw)
// make sure the sheets are displaying the correct data
gnv_App.of_Refresh_Sheets()
Another option is to load your table maintenance from cache with a RowsCopy. That would eliminate that database transfer if the data had already been loaded.