Hmm this gets trickier than I thought. GenericDataModel, which is what
FileDataModel delegates to, is also read-only, mostly to be efficient.
The complication is that User objects are also immutable for
simplicity. I can't make new User objects since they may be of a
domain-specific subtype. I could get into factory methods... like what
FileDataModel has... but then somehow I think it easier to finally
make User preferences mutable. Implementations could feel free to not
support it for speed; it could be an expensive operation since it
shouldn't get used much.

Still thinking out loud here -- will tinker more with the code. If it
is a change I'll end up making, I can do it today. No sense in waiting
around here.

On Tue, Apr 21, 2009 at 7:20 AM, Matthew Roberson <[email protected]> wrote:
> I am assuming that setPreference() adds the users preference for the given
> item to the datamodel w/o having to reread the file(s)?
> It just updates the DataModel contained in memory?
>
> If that is the case, then that is all I need to do.  However, I need to get
> a working demo of this by next week and do not want to put you out to
> include this functionality.

Reply via email to