I'm a bit confused about the differences between use and import dependencies in the package diagrams in UML modelling the java program.
My guess is that when the dependency import is used, the classes in the package being imported are used to instantiate objects in the importing package. When the dependency 'use' is used, the object or attributes or methods in the class of the package being imported are used in the importing package. Whichever dependency I use, I need to write:
public import...
in the code. Is that correct?
The difference from a language view is that in the
usecase you just pick certain parts from a package while theimporttakes all. Most programming languages take imported packages into their scope so you address elements from the package as being part of the importing itself. For theused ones you usually qualify the namespace.