Store changed options on client side

10 views
Skip to first unread message

Karl-Philipp Richter

unread,
Aug 6, 2016, 12:26:16 PM8/6/16
to jfreesan...@googlegroups.com
Hi,
I'd like to check if I understand correctly how `jfreesane` is
implemented currently. As far as I see there's no record to option
values in `jfreesane`, i.e. all values are written on the server
immediately and retrieved from there when option values are read.

I'm using `jfreesane` in an application where I want the user to be able
to configure some scanner options and this configuration ought to be
persistent accross restarts of the application. Therefore I need to
store the changes in a Map and de/serialize it.

Would it make sense to add a function to `jfreesane` to record all
changes, retrieve the changes and eventually restore them? I figured
`SaneOption.write[...]Option` would be a good location for that. Changed
options could be in a `Map<String, Object>` in `SaneDevice`.

-Kalle

James Ring

unread,
Aug 6, 2016, 6:23:20 PM8/6/16
to ric...@richtercloud.de, jfreesane-discuss
Hi Kalle,

On Sat, Aug 6, 2016 at 9:26 AM, Karl-Philipp Richter
<ric...@richtercloud.de> wrote:
> Hi,
> I'd like to check if I understand correctly how `jfreesane` is
> implemented currently. As far as I see there's no record to option
> values in `jfreesane`, i.e. all values are written on the server
> immediately and retrieved from there when option values are read.

That's correct.

> I'm using `jfreesane` in an application where I want the user to be able
> to configure some scanner options and this configuration ought to be
> persistent accross restarts of the application. Therefore I need to
> store the changes in a Map and de/serialize it.
>
> Would it make sense to add a function to `jfreesane` to record all
> changes, retrieve the changes and eventually restore them? I figured
> `SaneOption.write[...]Option` would be a good location for that. Changed
> options could be in a `Map<String, Object>` in `SaneDevice`.

I think that would be useful, but I suspect that whatever mechanism we
come up with wouldn't work for one application or another. Perhaps
it's best to leave the burden of option storage and replay to the
individual applications.

> -Kalle

Regards,
James
Reply all
Reply to author
Forward
0 new messages