• 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

UML and Java code mapping

 
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I read somewhere that:
(1) associations in UML class diagrams are mapped directly into the instance variables in the classes involved.
(2) multiplicity of the association is manifested by a Collection
(3) direction of the association is manifested by one class having an instance variable of type of the other class, but not vise versa.
(4) use/depend relationship is translated into "import" statement.
But when I read pattern books, the above mappings are not adhere to at all, I can not see the connection between the class diagram and the Java class code. Could it because:
(1) The above mappings are not RULES that need to adhere to.
(2) People some times are too lazy to make the mapping EXPLICIT for a novice like me to see.
(3) Something wrong with me.
Help please, thank you
 
Ranch Hand
Posts: 188
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by Jay Jones:
I read somewhere that:
(1) associations in UML class diagrams are mapped directly into the instance variables in the classes involved.
(2) multiplicity of the association is manifested by a Collection
(3) direction of the association is manifested by one class having an instance variable of type of the other class, but not vise versa.
(4) use/depend relationship is translated into "import" statement.
But when I read pattern books, the above mappings are not adhere to at all, I can not see the connection between the class diagram and the Java class code. Could it because:
(1) The above mappings are not RULES that need to adhere to.
(2) People some times are too lazy to make the mapping EXPLICIT for a novice like me to see.

Very likely is because sometimes the diagram illustrated are conceptual. But, when it comes to implementation....then all those "rules" may kick. This is so true esp if you're drawing logical conceptual designs as opposed to detail designs.

(3) Something wrong with me.
Help please, thank you

reply
    Bookmark Topic Watch Topic
  • New Topic