XML-RPC interface (was: Will GnuCash ever work for me?)
Derek Atkins
warlord@MIT.EDU
26 Sep 2001 11:31:19 -0400
Dave Peticolas <dave@krondo.com> writes:
> I don't think we are completely clean on this. We still have a few
> globals, like the commodity table and the GUID->entity hash table.
When I was working on the RPC Server I had noticed this. It was a
PitA. I would _definitely_ support a session object (whether it's a
gnc-book or something "above" it), that contains the commodity table
and GUID table.
In thinking about it, and thinking about how books work, I believe it
is possible that multiple books can share a namespace (e.g. when you
copy a book from one place to another). Therefore, session should be
broken out of gnc-book, and the "globals" should be moved into
sessions.
This would also require a 'major' API re-work, because everywhere that
UIDs are used it would require a session pointer. At least, this was
true when I was seriously working on the RPC backend.
> If we need something called a 'session' object, I think we should
> create a new object and take out the session handling code in gnc-book
> and leave the gnc books as the top-level data structure. When we
> just had account groups, we could just stick the account group in
> a session and the relationship was simple. But with commodities
> and scheduled transactions now, and possibly budgets, memorized
> transactions, etc. in the future, there is a lot of other data
> that is part of a gnucash data set. I think it is conceptually
> cleaner to have a top-level data object that represents an entire
> gnucash dataset, independent of a session, like account groups
> did before.
I agree. Question: can you think of cases where a GnuCash client (UI)
would have multiple sessions opened at once? I can certainly think of
cases where a "server" would (e.g. RPC Server).
This does lead to an interesting question: when would multiple books
be considered a part of the same session, and when would they be part
of different sessions (one client)?
> dave
-derek
--
Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
Member, MIT Student Information Processing Board (SIPB)
URL: http://web.mit.edu/warlord/ PP-ASEL-IA N1NWH
warlord@MIT.EDU PGP key available