• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Name uniqueness in UML

 
Rob Rider
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All!

Could anybody help me with short question about UML: is it possible to have class and component with the same name? UML 2.0 specfication says that element name should be unique in package, but can I have SomeService component (shown in component diagram) which is implemented in SomeService class (shown in class diagram)?

Thank you in advance,
Rob
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If the interface and the implementation have the same name, they must be in different packages. At the very least, you may need a SomeService interface and a SomeServiceImpl class.

If you put the components in different packages it is valid. It might be immensely confusing, but it's valid.

-Cameron McKenzie
 
Rodrigo Lopes Ferreira
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

If your component is an EJB, you must represent it in both component and class diagram, with the same name...


[]'s
 
Rob Rider
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!

So, if component is EJB, should I show SomeService interface and SomeServiceBean in class diagram and SomeService component in component diagram as follows:

Class diagram:


Component diagram:


Is it correct that SomeService component name will not conflict with SomeService interface name?

Thank you in advance,
Rob
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic