File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes Difference between class diagram and component diagram Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "Difference between class diagram and component diagram" Watch "Difference between class diagram and component diagram" New topic

Difference between class diagram and component diagram

Steven De Groote

Joined: Nov 23, 2006
Posts: 16

I'm working on part 2 for SCEA and I'm struggling a bit to work out what to put into my component diagram and what in the class diagram.

I was thinking to show the actual framework of my design in the component diagram (web pages, controllers, services, bus delegates, ...).
The I would limit my class diagram to only business classes.

But how do I show then the interaction/usage between my components and the business classes?
And also where should I put transfer objects then?


Web developer / SCEA / Owner
Ajith Kallambella

Joined: Mar 17, 2000
Posts: 5782
Components are usually higher level entities in your solution design and therefore, may be implemented using a bunch of classes. UML allows stereotyping, and I strongly recommend you to use stereotypes to add more clarity to your component diagram.

Back to your question, you can use the lollipop notation to depict interfaces exposed by a component. Remember that a component fulfills a functionality by exposing a set of behavior( via interfaces - not necessarily Java interfaces, but think of a "contract ). The best way to model a component is to include its interface descriptions. If you show all relevant interfaces in the component diagram, then you could use the same interface in the Class diagram to suggest the linkage. This is one way to do it.

Other way would be to use package notations. You can show what packages are in which component, and then use the same package name( as a stereotype ) in your class diagram. You can also get a bit more creative by using color codes( for example, all classes in a particular component are painted Yellow ).

I hope that helps.

Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
I agree. Here's the link:
subject: Difference between class diagram and component diagram
It's not a secret anymore!