On Tue, Sep 27, 2011 at 13:58, Vincent
Massol<vincent(a)massol.net> wrote:
Hi devs,
I'd like to propose to apply the -legacy module concept we have in platform
to XWiki Commons (and XWiki Rendering when a first need will arise).
The idea is to introduce a
xwiki-commons/xwiki-commons-core/xwiki-commons-legacy parent module.
My first use case is:
* Now that I've removed all usages of the old @Requirement annotation in
commons, rendering, platform, enterprise I'd like to make sure we don't use
it again and thus I'd like to add an aspect in
xwiki-commons/xwiki-commons-core/xwiki-commons-legacy/xwiki-commons-legacy-component/
to add support for the old annotations. More specifically I'd like to remove
the handling of the old Requirement annotation in ComponentDescriptorFactory
and add an around aspect to add support for it in the legacy module.
Thus I'd like to agree that we have 2 steps when it comes to deprecating
code:
1) Start by deprecating it using the @deprecate and @Deprecated javadoc and
java annotations. The code remains where it was before the deprecation
happens. This is a first step.
2) When our own code doesn't use any of the deprecated APIs then move the
code to a legacy module (either by moving an entire class if possible or by
using some Aspect to weave some methods for ex). This is a second step.
It has the following advantages:
* Our code remains clean of old deprecated apis
* Deprecated code is cleanly separated from new ways of doing things
* When new users download the our code they see the new ways (same for
javadoc generation)
* Users wanting to use the old APIs can still do so
Note: The question of when to remove completely the code from legacy is
another topic that I'd like to bring up too but in a different email thread
(I started writing a mail on this topic but need to finish it).
I know this will be another thread, but why not keep legacy and have a build
without legacy stuff.
This build could also be a good test that we really do not rely on legacy
stuffs.
+1, the legacy module should only be pulled in during releases. The
snapshots should be built without them, and the ci tests should be run
on a legacy-free build