ciruclar dependencies
Michael Stahl
mstahl at redhat.com
Tue May 29 04:07:20 PDT 2012
On 25/05/12 17:49, Tor Lillqvist wrote:
>> i believe cyclical dependencies indicate bad architecture. if 2 modules
>> depend on each other, then either they should be changed not to depend
>> on each other, or merged into one module.
>
> Hear, hear.
>
> Do you include run-time dependency in that? Like the couple of places
> where dynamic linking is used, to enable code in library A that
> depends on library B at compile-time to be used from library B at
> run-time. (I.e. B loads A and looks up one or a few functions from it
> dynamically.)
that kind of thing isn't particularly elegant, but in specific cases
there may be good reasons to do it in order to improve performance.
if the stuff in library B is used rarely, then splitting it out and
loading it on demand can improve startup performance, see e.g. the
msword library in sw, which is completely unnecessary if you create a
new document, or only use ODF; the fastest way to start is still to load
only the code that is necessary to start.
of course, if the stuff in library B is always loaded on every use of
something in library A it doesn't make sense to split them.
More information about the LibreOffice
mailing list