[Kmymoney-devel] Review Request: Balance cache object for use by MyMoneyFile

Alvaro Soliverez asoliverez at kde.org
Fri Sep 24 17:35:41 CEST 2010



> On 2010-09-22 10:41:13, Alvaro Soliverez wrote:
> > How do you propose to link this to the current code? There are several options.
> > You can either load the cache on the prefetch, or load that when a new balance is requested, etc.
> 
> Fernando Vilas wrote:
>     The plan is to load when each balance is requested. We may also want to prefetch certain balances such as "today for all open accounts"

On that subject, I'd test whether it's worth storing the balance for any date that has a transaction, or at least for a date range that covers most usage (forecast, budget, etc.)
Forecast does a similar thing and it's quite performing.


> On 2010-09-22 10:41:13, Alvaro Soliverez wrote:
> > /trunk/extragear/office/kmymoney/kmymoney/mymoney/mymoneybalancecache.h, line 71
> > <http://svn.reviewboard.kde.org/r/5404/diff/1/?file=36726#file36726line71>
> >
> >     What's the purpose of this date? The BalanceCacheType already has a date, and the less data we store here, the faster it will go.
> >     I would drop this class and only store a MyMoneyMoney object instead of a MyMoneyBalanceCacheItem.
> 
> Fernando Vilas wrote:
>     I agree with only storing the MyMoneyMoney object. I will update the code in the cache to do so. At this point, the class mostly serves to indicate that a balance was not found for a call to either balance() or mostRecentBalance().
>     
>     MyMoneyMoney has no way to indicate an invalid object, and I do not want to throw an exception for a cache miss. Another option is to have the balance cache itself fetch the balance on a miss, but I was trying to avoid that.

Why not use find() to check whether a certain date is in the map? That would tell if it's a miss, and it's at most as expensive as retrieving an empty object.


- Alvaro


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://svn.reviewboard.kde.org/r/5404/#review7722
-----------------------------------------------------------


On 2010-09-22 03:08:01, Fernando Vilas wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> http://svn.reviewboard.kde.org/r/5404/
> -----------------------------------------------------------
> 
> (Updated 2010-09-22 03:08:01)
> 
> 
> Review request for kmymoney.
> 
> 
> Summary
> -------
> 
> Initial cut at the balance cache for the MyMoneyFile layer. Nothing uses it other than the test driver yet, but that will change once this is committed. Does it have a reasonable interface? Does it need something else added, like a model interface?
> 
> This interface is subject to change for now, but should be stable enough to start the next phase if it does not need revision first.
> 
> 
> Diffs
> -----
> 
>   /trunk/extragear/office/kmymoney/kmymoney/mymoney/CMakeLists.txt 1178028 
>   /trunk/extragear/office/kmymoney/kmymoney/mymoney/mymoneybalancecache.h PRE-CREATION 
>   /trunk/extragear/office/kmymoney/kmymoney/mymoney/mymoneybalancecache.cpp PRE-CREATION 
>   /trunk/extragear/office/kmymoney/kmymoney/mymoney/mymoneybalancecachetest.h PRE-CREATION 
>   /trunk/extragear/office/kmymoney/kmymoney/mymoney/mymoneybalancecachetest.cpp PRE-CREATION 
> 
> Diff: http://svn.reviewboard.kde.org/r/5404/diff
> 
> 
> Testing
> -------
> 
> Built test driver, and the object passes all tests. Hooray, test-driven-development
> 
> 
> Thanks,
> 
> Fernando
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/kmymoney-devel/attachments/20100924/42f7f1c8/attachment.htm 


More information about the KMyMoney-devel mailing list