Announcement Announcement Module
Collapse
No announcement yet.
problem about bundle dependent Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    Hi,

    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.

    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

    Comment

    Working...
    X