[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Monotone-devel] Re: RFC: workspace migration and work.cc refactor [net.
From: |
Graydon Hoare |
Subject: |
[Monotone-devel] Re: RFC: workspace migration and work.cc refactor [net.venge.monotone.workspace-merge.migration] |
Date: |
Mon, 31 Jul 2006 16:24:07 -0700 |
User-agent: |
Thunderbird 1.5.0.5 (Windows/20060719) |
Zack Weinberg wrote:
Also on this branch is a massive refactor of work.cc. I didn't *need*
to do that for this change, but it wanted doing, and now I have a much
better handle on what work.cc does.
Ok.
However, what it does have is references to the database and
lua_hooks objects.
Ownership as sub-objects, or pointers, or C++ & references?
not to take an app_state reference as an argument. I notice that
database and lua_hooks themselves hold references -- to the entire
app_state object. If I did that in work, then all of the app_state
arguments could go away; on the other hand, there's a degree of extra
documentation in just which methods do take those pointers. Which is
preferred?
I'm a bit ambivalent about it. What I'd like are possibly contradictory
goals:
- minimize the use of raw pointers
- keep everything in a tree under a single root object
- move sensible subsets of app_state into sub-objects (options,
workspace state, etc.) to improve program clarity
- don't introduce so much "information hiding" that parts of the
program do unusual amounts of work to get the information they
need anyways
If you're doing all that, or approximating it tastefully, I'm all in
favor of refactoring. I haven't read your branch yet though.
-graydon