Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Difference between class diagram and component diagram

 
Steven De Groote
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

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?


Thanks
 
Ajith Kallambella
Sheriff
Posts: 5782
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic