Component and Deployment Diagrams
In my experience, the last two diagrams defined by UML are the least-often used. A component diagram (such as that shown in Figure 4) identifies the various components of a system, the interfaces they provide and those upon which they depend.
Deployment diagrams (such as that shown in Figure 5) are similar to component diagrams, except that they show the physical machines or types of physical machines in a network and the components that are deployed in each.
Relationship to Java Code
Components are generally considered to be a group of classes and interfaces that collaborate to form some larger conceptual part of a system. Therefore, a component can be the classes and interfaces that form an Enterprise Java bean, a Java package, or the contents of a jar file, for example.
Figure 4 UML component diagram.
Using Component and Deployment Diagrams
The idea of using UML component and deployment diagrams to help manage the definition and deployment of J2EE systems across different hardware configurations has been floated by some of my colleagues from time to time (without much concrete progress, however).
Most projects have some diagrams of this sort sketched on a whiteboard or in a slideshow presentation drawn using clip art symbols. Few projects with which I have been involved have bothered to draw formal UML component and deployment diagrams. However, the notation is defined if it is useful or necessary to use it.
Figure 5 UML deployment diagram.