On 6 avr, 04:31, John Gunther <[email protected]> wrote:
> Sorry, for late reply, I just saw your post.
>
> I think you are correct. But, my goal is to eliminate the need for
> users to physically add the extra JAR file associated with the
> optional library to their project (unless they need the optional
> features it provides).
>
> What I want is:
>
> o Just 1 JAR distributed by me.
> o Code for optional library in separate JAR distributed/maintained
> by others
> o Users of my library don't have to physically mess with the
> optional JAR (no need to
> download it, place it on build path, or add an inherits clause) if
> they don't use those
> optional features in their code.
>
> Ideally, my code might even somehow check if the optional library is
> available. If so, it uses it, otherwise it uses the built-in fallback.
> But it would be OK if the developer using my library would just tell
> it if the optional library is to be used or not.
Can't you put those optional features into another module that
developers would only inherit if they want to (and thus would have to
pull the third-party JAR and put it in the classpath only when opting-
in)?
If you don't want (or can't, for whichever reason) separate the
optional features in a distinct module, than you can use deferred-
binding; and opting-in could be either:
- inheriting another module containing the appropriate <replace-with>
mappings
- setting a property (<set-property>) to a specific value (this
property having been set to a "default" value in your module) which
would trigger different <replace-with> rules (all in the same module),
e.g. your module contains (along with all the needed <generate-with>
mappings) <define-property name="use.optional.features"
values="true,false"/><set-property name="use.optional.features"
value="false"/>, and the developer opts in by adding this line to his
module: <set-property name="use.optional.features" value="true"/>
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---