Results 1 to 2 of 2

Thread: problem about bundle dependent

  1. #1
    Join Date
    Oct 2008
    Posts
    1

    Default problem about bundle dependent

    there are 3 bundles:util bundle,dao bundle,service bundle.
    the dao bundle import the util bundle and also add the project references,the service bundle import the dao bundle and also add the project references.
    the util bundle and dao bundle is fine,but the service bundle can't pass complie in eclipse,the error message is that:can't find a class which is in the util bundle.when i import the util bundle into the service bundle,all is ok.
    should i need to always import the util bundle when a bundle import the dao bundle?that is very bad!!

  2. #2
    Join Date
    Jan 2006
    Location
    Zürich, Switzerland
    Posts
    423

    Default

    Hi,

    Quote Originally Posted by sdhjc View Post
    can't find a class which is in the util bundle.when i import the util bundle into the service bundle,all is ok.
    should i need to always import the util bundle when a bundle import the dao bundle?that is very bad!!
    If the compiler tells you that the Service bundle can not compile because it can not find a class which is in the Util bundle, then the compiler is practically guaranteed to be correct.

    In other words some class in the Service bundle must actually use a type from the Util bundle, in which case, yes, you will need to import the appropriate packages from the Util bundle in the manifest of your Service bundle.

    Quote Originally Posted by sdhjc View Post
    should i need to always import the util bundle when a bundle import the dao bundle?
    No, not necessarily. The general rule is: whenever you have a dependency on the types exported by another bundle, you need to import the packages that contain those types. Otherwise, you won't be able to see those types at all.

    Regards,

    Sam

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •