Implementing UML diagram to Java [closed]

Answer to your Question: No you dont have to use constructors, none of the classes shows one so youre fine with just the default constructors beeing generated while compiling.

Here is what you can do based on the assumption that this pictures information is stored in a understandable format (like for example extracted from IBMs Enterprise Architect).

1.) Learn Java so you can transform for example the box “CEO” into this:

public class CEO extends Employee{

 public void printDetails(){}


2.) Use a IDE/ Tool that can generate such class skeletons based on your diagramms information. ArgoUml, Enterrpise Architekt, BlueJ, IntelliJ and stuff, just google for “java uml to code”

3.) Write a Tool that parses UML pictures metadata and generates the appropriate code.

In your case you probably want to go for 2.) and then hire a application developper to fill the generated skeletons with functionality.

Edit: As other comments suggested there is a problem with your diagramm. Before programms like in 2.) above can parse the information to generate class skeletons it must be understandable what the relations (arrows) in your diagramm express. Look at the relation between for example Office and Departement. I as a human can interpret this as “yeah that arrows probably do tell that a office extends from a Departement rather than telling me that a Departement has a reference to a Office and vice a verse”. But that a tool can make this decission it must be clear what of both is meant. Usualy this arrows would suggest both classes holding a references to the other one and you probably rather want a single arrow pointing from Office to departement that has a Label “extends” or “implements” attached.

Leave a Comment