Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

Simply, If I use reflection to add methods or functionality to a class defined in a LGPL'd library I'm linking to, does that count as a modification to the existing library and would my reflective code have to be released under the LGPL?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

http://www.gnu.org/licenses/lgpl-3.0.en.html

I'd say that reflecting into the LGPL lib is a 'combined work' and so is subject to the limitations described in the licence:

A “Combined Work” is a work produced by combining or linking an Application with the Library. The particular version of the Library with which the Combined Work was made is also called the “Linked Version”.

The “Minimal Corresponding Source” for a Combined Work means the Corresponding Source for the Combined Work, excluding any source code for portions of the Combined Work that, considered in isolation, are based on the Application, and not on the Linked Version.

The “Corresponding Application Code” for a Combined Work means the object code and/or source code for the Application, including any data and utility programs needed for reproducing the Combined Work from the Application, but excluding the System Libraries of the Combined Work.

So, given these definitions (where your reflecting into the library is equivalent to linking with it and the code that does the reflection is the minimal corresponding source) you have to follow this section:

  1. Combined Works.

You may convey a Combined Work under terms of your choice that, taken together, effectively do not restrict modification of the portions of the Library contained in the Combined Work and reverse engineering for debugging such modifications, if you also do each of the following: ...

d) Do one of the following:

0) Convey the Minimal Corresponding Source under the terms of this License, and the Corresponding Application Code in a form suitable for, and under terms that permit, the user to recombine or relink the Application with a modified version of the Linked Version to produce a modified Combined Work, in the manner specified by section 6 of the GNU GPL for conveying Corresponding Source.

1) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (a) uses at run time a copy of the Library already present on the user's computer system, and (b) will operate properly with a modified version of the Library that is interface-compatible with the Linked Version.

so I'd say (Note: IANAL) you'd have to release the reflecting code part of your app under the LGPL too, though the section of your app that uses that code can still be proprietary.

share|improve this answer
    
Thanks gbjbaanb, this answer makes an excellent companion to my answer to Does the LGPL allow me to do this? which only speaks about LGPL 2.1, so I've added a link to your answer from mine. –  Mark Booth Mar 1 '12 at 12:46
add comment

I'd say this is hardly different from creating a new class by extending a base class in an LGPL library. You're just doing the introspection at run time instead of compile time. Therefore, it's a derivative work, which doesn't require you to disclose your source code.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.