• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
  • Mikalai Zaikin

Difference between class diagram and component diagram

Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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?

Posts: 5782
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
    Bookmark Topic Watch Topic
  • New Topic