I thought along the same lines, but Shai has really nailed the idea.  I'd 
add one thing;  DO NOT write two sets of code, one for 
working online and a fall back to use when offline.  Structure your code to 
always use the same cycle - update local database, 
record "pending" transactions, post pending transations to the real server.

On Saturday, September 19, 2020 at 10:22:43 PM UTC-7 Shai Almog wrote:

> Hi,
> working offline is pretty complex. I would suggest creating a local DB 
> that mirrors the one within the webservice. You would then need to create 
> an update strategy that periodically refreshes the DB based on updates in 
> the server.
> For submitting operations done locally you would need to use something 
> like a command patterns that classifies an action as "Pending" until the 
> server approves it. Then when networking is available you need to try 
> submitting an order and fail gracefully for the case of server failure.
>
> I think the caching related features aren't really useful for your case as 
> you need to actually write the business logic related to database 
> replication and merging. It isn't rocket science but it's still a bit 
> challenging.
>
> On Saturday, September 19, 2020 at 7:03:43 PM UTC+3 [email protected] 
> wrote:
>
>> Hi,
>>
>> I have a street sales project that has to continue working when the data 
>> signal is low or does not exist.
>> I count at least 10 tables that I have to access from my webservice and 
>> many handle high volume (for example: "price list").
>> I read the "Automatic Caching" blog and find it great. However, I have a 
>> hard time implementing it. Do you have any example code that allows me to 
>> guide myself on the subject?
>>
>> Regards
>>
>>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/010c7601-8336-4fb6-86fc-900426104118n%40googlegroups.com.

Reply via email to