-1

I have drawn UML class diagram. Now, my task is to convert that UML class diagram to equivalent Java code.

I do not want to use any automated tool, which generates Java code from UML diagram.

Kindly provide some pointers (webLink, PDF file , other), which talks about UML and its equivalent Java Program.

4dgaurav
  • 11,360
  • 4
  • 32
  • 59
user-517752
  • 1,188
  • 5
  • 21
  • 54

4 Answers4

5

This 11-page PDF describes a mapping from UML notation to Java conventions. For example, implementing cursors as Java Enumerations, reducing multiple inheritance to single, etc.

Here is a 4-part article on the same subject:

Part 1

Part 2

Part 3

Part 4

Joe Coder
  • 4,498
  • 31
  • 41
  • 3
    Thanks for your pointer. I am adding some more basic stuff : http://www.ibm.com/developerworks/rational/library/769.html – user-517752 Feb 19 '12 at 18:10
2

If you don't want to use an automated tool, the only alternative is to open a text editor or IDE and create each Java class's .java file by hand.

For every UML class, create a Java class. Add all the methods and data members you want in those classes.

If there's inheritance called for by the model, have your Java classes extend those classes or implement those interfaces.

Did I misread this question?

duffymo
  • 305,152
  • 44
  • 369
  • 561
  • Let me rephrashed my question : For instance, In UML diagram, we draw Inheritance from one class to other class. then its equivalent Java code is Class A extends Class B { ..... } . My requirement is I need a web link , which talks about these types of other relationship and its Java code. – user-517752 Feb 18 '12 at 18:07
  • So what you are looking for is a translation from UML concepts into Java concepts, not from a UML diagram to Java code? – G. Bach Feb 18 '12 at 18:36
  • My advice is to just start writing code. Voting to close. – duffymo Feb 18 '12 at 18:49
1

I do not want to use any automated tool, which generates Java code from UML diagram.

Then use Eclipse or vi :)

Laurent Grégoire
  • 4,006
  • 29
  • 52
0

If you know how class diagrams work, then you should be able to write a Java program from the diagram.

A class diagram has attributes, functions and relationships. In a Java class, the attributes are variables and the methods are functions. The relationships in Java are either extends (for inheritance) or implements.

If there are other specific things that aren't obvious you could ask, but you should be able to translate to code from the design pretty easily.

user1183661
  • 93
  • 1
  • 4
  • Finally, I found sometime that I was looking for. http://www.coderanch.com/t/443002/java/java/Java-Coding-UML-Aggregation-Composition – user-517752 Feb 18 '12 at 18:50