KDE/kdevplatform

Andreas Pakulat apaku at gmx.de
Sun Feb 24 00:10:50 UTC 2008


On 23.02.08 23:48:58, David Nolden wrote:
> SVN commit 778610 by zwabel:
> 
> ContextOwner was only needed because of Definition, and pure Definitions do not make sense because:
> - Declarations sometimes are definitions anyway
> - For global functions, sometimes a definition should be interpreted as a declaration at the same time, while still mapping to a pure declaration in a header.
> - Definitions did not store comments and potentially other useful information.
> - Parsing definitions represented as a separate class was quite painful in C++ support.
> - Separate definitions made the code more complex.
> 
> So from now on, definition and declarations are always represented by "Declaration", and separate definition/declaration mapping happens through the "definition()" and "declaration()"
> functions.

Does this gain anything except fewer classes in the API? IMHO such API
changes should be discussed on the list instead of being decided simply
by you.

The naming of the Declaration class(es) is now completely wrong as they
might also be definitions. No amount of apidox can help with such bad
namings.

Also I don't quite like the look of:

void doSomething(Declaration* decl) {

Declaration* def = 0;
if( decl->isDefinition() ){
def = decl;
} else {
def = decl->definition();
}
...
}

instead of just

void doSomething(Definition* def) {
...
}

Andreas

-- 
Give your very best today.  Heaven knows it's little enough.




More information about the KDevelop-devel mailing list