On 10/5/2010 11:41 PM, osimons wrote:
On Oct 5, 3:56 pm, Christian Boos<[email protected]> wrote:
On 10/1/2010 9:47 PM, osimons wrote:
1. Complex classes. Formatter, Context, GenericObject (or whatever)
contains an inner life and structure that I'd need to understand.
Complex, nested in several layers. They have non-descript names and
what they do and how they do it is not obvious by looking at them.
To improve the situation a bit, I'd like to rename Context to
RenderingContext, on trunk.
The old name will be kept for compatibility, Context = RenderingContext.
In the WikiParser branch, the new formatter classes could be renamed
WikiFormatter.
For Resource, I think it might be clearer to have an explicit `copy()`
method when creating a resource from another one, rather than the
shortcut `__call__` form (as a proof, before looking again at the code,
I thought `__call__` would do the same as `child()` ;-) ).
Same clarification needed for RenderingContext, were a `nested()` method
would be better than `__call__()`.
-- Christian
+1. Better names. Particularly the .copy() method should be added and
used in our code. I don't mind it also supporting the short-form via
__call__ -> copy(), but we should make our own code as readable as we
can.
Ok.
As for nested (parent-child) contexts (and resources), could we not
just use the familiar .append()?
For resources, we have already the notion of .parent, so for creating a
sub-resources, using .child() seemed preferable to, say, ".sub()". And
talking about a child resource makes sense, I think, to convey the
notion of dependence upon its parent.
For rendering contexts, the situation is a bit different, as it's really
about nesting representation of one resource into others (e.g.
information about a ticket rendered into the description of another
ticket, rendered in a [[TicketQuery]] within a Wiki page). While talking
about the parent context, when going from the most nested to the
wrapping context makes sense, "nested" seems more appropriate than
child() for the other direction (as there's no real dependence upon the
wrapping context).
But in neither of the two above cases, .append() seems descriptive and
really appropriate to me?
-- Christian
--
You received this message because you are subscribed to the Google Groups "Trac
Development" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/trac-dev?hl=en.