On Wed, May 2, 2018 at 4:00 AM, vitalije <[email protected]> wrote:

I really can't understand what do you mean. Do we look at the same code?
>
> For me, architecture comes first.  Imo, simplifying code at the expense of
>> adding hidden dependencies between classes is a no no.
>
>
> And yet we would have never had this discussion if VNode was not heavily
> dependent on a Commander class and its helper classes.
>

​- The VNode class is *not* heavily dependent on the Commands class. It has
a reference to it, but knows *nothing* about how other classes use that
reference. In fact, the VNode class knows *nothing* about v.context.
That's completely reasonable.

- The VNode class knows *nothing* about v.gnx (v._fileIndex), and
knows *nothing
* about other classes use v.gnx.

The VNode class just stores data. The Position class must have access to
v.context, but that does not complicate the VNode class in any way.
​


> The proposed new code is likely to increase the hidden connection between
> the VNode and Commands classes.  This is a big step backwards.
>

>> I can't see why do you think so.
>

​The vnode-standalone branch causes the git-diff command to fail.  This
failure is a symptom of hidden connections between the proposed new code
and far distant code.  To my knowledge, this has never happened before in
Leo's history.

​The proposed ​@staticmethod addition are a solution to a problem that
*absolutely* should not be part of the VNode class.  It's not the job of
the VNode class to manage fc.gnxDict.  At present, the VNode class doesn't
know anything about fc.gnxDict.

>
​
I don't recall that I ever complained about gnx computation or that I had
any intentions to simplify it using VNode class. Therefore I don't
understand what your comment refers to.

Then why the @staticmethod additions
​ to the VNode class​
?

It is certainly possible to do
> ​[use a DummyCommander instance], but to me that is an ugly hack. It is
> far from being an elegant solution that I would be proud of or one that I
> would have much confidence in.
>

​We both agree about this.  But the DummyCommander class will never be
needed, because all classes can easily set context=self.c when
instantiating a VNode.  Or, they could just call c.new_vnode().

*Summary*

The vnode-standalone branch adds completely unnecessary complications to
the VNode class.  That's not going to happen.

Edward

-- 
You received this message because you are subscribed to the Google Groups 
"leo-editor" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/leo-editor.
For more options, visit https://groups.google.com/d/optout.

Reply via email to