incubator-jspwiki-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Volkar, John M." <JVol...@medrad.com>
Subject RE: [jira] Commented: (JSPWIKI-423) Plugins should use annotations instead of jspwiki_module.xml
Date Tue, 11 Nov 2008 03:50:21 GMT
Discussion out side of JIRA is okay right?

----
I'm frankly quite surprised at the seeming jump on the annotation
bandwagon.  I *like* annotations and all, but I fail to see exactly how
they improve things over simply adding a few abstract methods to
WikiPlugin such as:

getMinVersion()
getMaxVersion()
Or 
getWhateverIsNeeded() 

Since the basic rule for a plugin is that all significant construction
work should be done in the init method, and a no arg constructor is
required to be available, I fail to see why simply new'ing it and
calling a few getters is not sufficient. 

And frankly I don't like getters for the version stuff, why not just let
the PluginManager ask a plugin if its compatible...

WikiPlugin candidate = new SomeRandomPlugin() <<or however you get a
newInstance from a class string.
If (candidate.isCompatibleWith(jspwiki_version)) register(canidate);

I mean, if a plugin class has dependencies that cause class-loading to
fail, then annotations don't help you either right?  That reason is
actually the *only* reason that I thought jspwiki_module.xml was maybe
okay, you could inspect it without loading the class (which might fail
because of dependencies).

<sigh/> Maybe I should crawl back under my rock; I seem to have missed
much discussion.

Regards,
John Volkar




-----Original Message-----
From: Andrew Jaquith (JIRA) [mailto:jira@apache.org] 
Sent: Monday, November 10, 2008 10:12 PM
To: jspwiki-dev@incubator.apache.org
Subject: [jira] Commented: (JSPWIKI-423) Plugins should use annotations
instead of jspwiki_module.xml


    [
https://issues.apache.org/jira/browse/JSPWIKI-423?page=com.atlassian.jir
a.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=1264645
3#action_12646453 ] 

Andrew Jaquith commented on JSPWIKI-423:
----------------------------------------

A few quick thoughts:

* It's true, Stripes 1.5 does not scan the entire classpath anymore...
and this is definitely a feature because it speeds up startup
* The Stripes approach for locating optional classes is to specify what
packages contain Stripes "extensions". This is done by having
ResolveUtil search a comma-separated list of packages in a servlet
init-param, e.g., "com.ecyrd.jspwiki.action,net.sf.stripes".
* JSPWiki could do the same thing (but configure the packages to search
via jspwiki.proprties, I'd expect) 

Also, could we think a little more creatively about the annotation name?
"ModuleData" just leaves me cold. I'd suggest something a little more
suggestive of the classes it annotates. For example, "WikiExtension" or
"WikiModule" is a lot better.

> Plugins should use annotations instead of jspwiki_module.xml
> ------------------------------------------------------------
>
>                 Key: JSPWIKI-423
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-423
>             Project: JSPWiki
>          Issue Type: Improvement
>          Components: Plugins
>            Reporter: Janne Jalkanen
>            Assignee: Janne Jalkanen
>             Fix For: 3.0
>
>
> Use of annotations makes it much easier to keep a plugin up to date.
Please see org.apache.jspwiki.api.ModuleData annotation.

--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message