This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 27055 - Projects API should be autoload module
Summary: Projects API should be autoload module
Status: CLOSED WONTFIX
Alias: None
Product: projects
Classification: Unclassified
Component: Generic Infrastructure (show other bugs)
Version: 3.x
Hardware: PC Linux
: P1 blocker (vote)
Assignee: Vitezslav Stejskal
URL:
Keywords: API
Depends on:
Blocks:
 
Reported: 2002-09-05 15:32 UTC by Jaroslav Tulach
Modified: 2003-12-11 14:25 UTC (History)
1 user (show)

See Also:
Issue Type: TASK
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2002-09-05 15:32:49 UTC
It has been realized as a result of "Versioning of
modules" discussion between me and Jesse 
(available at
http://openide.netbeans.org/servlets/BrowseList?listName=dev&by=subject&from=147225)
that the best distribution of a module API is as
autoload module. As such the GUI needs to be
separated from the module otherwise it might not
get enabled at all.

So I suggest to create module projects-api.jar
that will contain the APIs + some necessary impl,
but no GUI. Also create another module
projects-gui.jar that will provide the rest. The
projects-api should be autoload, projects-gui
should depend on it and be either regular module
or it might provide something that projects-api
requires. So as soon as somebody needs the
projects-api, the gui is also enabled.

If there is a need to communicate between
projects-api and projects-gui, you can use
following trick. In projects-api have a class
org.netbeans.modules.projects.Access that is
abstract with all methods you need from the GUI
part and static getter that uses lookup to get its
instance. The projects-gui will then implement the
Access class and register it in lookup
(META-INF/services/org.netbeans.modules.projects.Access).

Please restrict API packages in projects module so
nobody can call the Access class if it depends
just on specification version (the projects-gui
needs to depend on implementation version).
Comment 1 Jesse Glick 2002-09-05 18:53:40 UTC
One thing: if p-gui depends on p-api, you cannot have p-api require
some token and p-gui provide it, because that would be cyclic. However
recommended style is this:

1. p-api has an API and an SPI. SPI describes a (singleton?)
implementation, say some abstract class.

2. p-gui depends on p-api, registers to lookup an impl of the SPI, and
OpenIDE-Module-Provides the class name of the abstract SPI class too.

3. Other modules depend on p-api and OpenIDE-Module-Requires the same
token.

If you later decide to supply a non-GUI impl as a third module, usable
programmatically but with no UI, then you would have

1. p-api (autoload): defines API and SPI

2. p-impl (autoload): depends on p-api, implements SPI and provides
the token

3. p-gui (regular): depends on p-api, requires token

4. other modules: depend on p-api, require token
Comment 2 Vitezslav Stejskal 2002-09-09 22:45:19 UTC
I'll take this task.
Comment 3 Vitezslav Stejskal 2002-10-29 12:42:37 UTC
The projects module is split to two modules projects-core and
projects-ide. See details on
http://projects.netbeans.org/openissues/incompatible_issues.html and
http://projects.netbeans.org/openissues/upgrade_27055.html.

(related issue #27915)
Comment 4 Jaroslav Tulach 2002-10-29 16:09:17 UTC
This separation is good, but it does not exactly solves the problem
that this issue wanted to solve.

The problem is the preservation of investments and continuability and
upgradability of modules. Because the project api depends on old
datasystem it is possible for it to become obsolete. Then one needs to
introduce emulator module. The thing is complex but believe me that it
is much easier to provide the emulator module if it was always just
autoload without any user functionality.
Comment 5 Vitezslav Stejskal 2002-10-29 16:48:45 UTC
OK, I believe you, let's start preserving ...
Comment 6 Pavel Buzek 2002-11-12 16:51:18 UTC
schedule (4.0/milestone7)
Comment 7 Vitezslav Stejskal 2003-11-26 12:52:50 UTC
As described in
http://www.netbeans.org/servlets/ReadMsg?msgId=619519&listName=nbdiscuss the
current work on projects prototype has been stopped.
Comment 8 Vitezslav Stejskal 2003-11-26 14:58:03 UTC
--> VERIFIED