kdom and khtml integration
Frans Englich
frans.englich at telia.com
Tue Feb 28 12:46:15 GMT 2006
On Monday 27 February 2006 18:59, Maks Orlovich wrote:
[...]
> > Here is an unordered list of the "good things from kdom":
> > * One-Class-One-File policy aka. having kxml/core/NodeImpl.cpp
> > AttrImpl.cpp etc..
>
> I would actually consider this to be a Very Bad Thing.
>
> Amongst disadvantages:
> - Longer compile times
>
> - Much harder to work on related areas of code: while right now one can
> open 2-6 files and be done, this would potentially involve opening 30+.
> Also consider e.g. working on attribute handling. That generally involves
> touching AttrImpl, AttributeImpl, NamedAttrMap, ElementImpl, etc. These are
> now all nicely in the same file, so one can get a decent overview without
> scooting around. Not to mention do you really think classes whose
> implementation is this long: ChildNodeListImpl::ChildNodeListImpl( NodeImpl
> *n ): NodeListImpl(n, CHILD_NODES) {}
>
> bool ChildNodeListImpl::nodeMatches( NodeImpl* /*testNode*/, bool&
> doRecurse ) const {
> doRecurse = false;
> return true;
> }
>
> deserve separate files?
Here's the advantages I see:
* You don't have to memorize or learn where classes hides. Class Foo is in
Foo.h. Simple. This is practical for new-comers, and also when not having
worked on a particular area for a while.
* KDOMBinder gains from my point above; it doesn't need to be taught about an
arbitrary way of how to include files, it have a strong pattern for doing it.
* The Apple folks are adopting KDOM's directory/file structure, I think Hyatt
once said on IRC. (lurkers can deny/confirm)
* KDOM is large. In addition to what kdelibs have, it has the Load and Save
and XPath module(when we're talking about DOM). I think it is very practical
to have a strong, simple, easily-guessed convention for keeping the
complexity down.
But as Nikolas says, it's not black and white; in some cases in the XQuery
code I have multiple classes in one file, for example.
End point: yes, I do see observable user benefits.
Cheers,
Frans
More information about the kfm-devel
mailing list