[ 
https://issues.apache.org/jira/browse/JSPWIKI-38?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12658398#action_12658398
 ] 

Andrew Jaquith commented on JSPWIKI-38:
---------------------------------------

Some comments on the .api package:

* I do NOT like the idea of creating a separate org.apache.jspwiki.api package. 
That seems like one abstraction too far. It is awkward and unnnatural, and it 
just looks funny. You do not see this in slf4j or the J2EE servlet packages. 
What you see (in those examples) are interfaces everywhere, and sub-packages 
called .spi, or .impl or similar that contain the actual implementations.
* I DO like the idea of "coding to the interface" -- making sure we create 
well-defined interfaces that substitute for what are, today, concrete classes.

So, I think we make should change our approach slightly.

First, the current interface classes in the proposed org.apache.jspwiki.api 
package should be moved to org.apache.jspwiki. We should start replacing 
concrete implementations in the code with the interfaces immediately. Janne has 
already done this with WikiPage; the next one should be WIkiContext (the one in 
the top-level com.ecyrd.jspwiki package  is the correct one to use.

Second, the contract we should follow, at least in the top-level 
org.ecyrd.jspwiki package, should be this: any interfaces are guaranteed to be 
the "permanent" API. Concrete implementations (example: JCRWikiPage) will be in 
.spi or .impl subpackages. 

Third, we should consider creating a separate source folder (proposed name: 
api) that creates a separate jspwiki-api.jar. Concrete implementations go in 
the regular jspwiki.jar. I would be happy to make the modifications to the Ant 
script and Eclipse workspace files to do this.

The advantage of this approach is that it would make moving to the apache 
namespace fairly easy: just change com.ecyrd.jspwiki to org.apache.jspwiki, in 
most cases. There would need to be some cases where callers might need to use a 
factory class instead of constructors, but those should be fairly easy to 
figure out.

> Rename packages to "org.apache.jspwiki"
> ---------------------------------------
>
>                 Key: JSPWIKI-38
>                 URL: https://issues.apache.org/jira/browse/JSPWIKI-38
>             Project: JSPWiki
>          Issue Type: Task
>            Reporter: Janne Jalkanen
>            Assignee: Janne Jalkanen
>             Fix For: 3.0
>
>


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

Reply via email to