• 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 ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Name uniqueness in UML

 
Greenhorn
Posts: 15
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic