2009/9/3 Guillaume Nodet <gno...@gmail.com>

> Fileinstall exports the org.osgi.service.cm and org.osgi.service.log
> packages.
> I wonder if this would make more sense to make them optional import and
> make
> sure the code can run if those are not wired.
>

yep, this comes down to whether you should package the API with the bundle
or not
( and as Richard says FileInstall doesn't implement the API, so no need to
export it )

   http://www.mail-archive.com/osgi-...@mail.osgi.org/msg00097.html

for an optional dependency it can make sense to use an optional import -
although
it does then make the code a little bit more involved, as your recent commit
shows

you should also remember optional imports are only checked *once* at
resolution

for example, if I start the FileInstall bundle without the LogService API
available and
only later on install a logger, then FileInstall won't pick up this service
until its bundle
is refreshed ( to handle this use-case you would need DynamicImport-Package
)

As a side effect would also reduce the size of the jar and simplify the
> resolution process (I don't having having bundles exporting the same
> package
> really helps ...)
>

well some people will want to bundle APIs with their implementations
(potentially one
less bundle to manage) and in this case exporting+importing the API makes
sense

most of the performance issues I've seen wrt. resolution have been from bad
APIs
which have lots of uses constraints - I think that's more of a problem to be
honest

Thoughts ?
>
> --
> Cheers,
> Guillaume Nodet
> ------------------------
> Blog: http://gnodet.blogspot.com/
> ------------------------
> Open Source SOA
> http://fusesource.com
>



-- 
Cheers, Stuart

Reply via email to