X

Shay Shmeltzer's Oracle Development Tools Tips

Java Class and UML Modeling with JDeveloper

Shay Shmeltzer
Director of Product Management - Oracle

Do you design before you code? It used to be a best practice to do that, but now with agile development on the rise it seems less people actually do conceptual design as they rather just code as fast as possible.

One nice feature of JDeveloper is that it can make it seem like you actually did conceptual design even if you didn't do it.We can take code that you wrote and make a diagram out of it so you can pretend you modeled things - or in case you need to explain what you did to your managers.

JDeveloper is one of the more powerful free tools out there that offers UML modeling for your code. We do both conceptual modeling - which is not tied to a specific language implementation, and physical modeling of Java code. In the demo below I'm showing how easy it is to start for a set of Java classes that you coded, and transform them into a Java class diagram, then take the physical model and transform it into conceptual UML class diagram, and then take that conceptual model and transform it to another type of physical model - a database model.

Join the discussion

Comments ( 9 )
  • juan Wednesday, August 31, 2011

    Very handy Shay, but i have a related question for you. What about creating sequence diagrama with this uml classes? I tried to create a sequence diagram with the uml classes but is very annoying since you can´t drag the new uml classes. Instead, you have to create a new object lifeline, then go to the properties put the name and select the class....I am missing something or this is the only way to go?

    thanks!


  • Shay Thursday, September 1, 2011

    Juan - I'm not exactly sure what you mean when you say "creating sequence diagrama with this uml classes" - these two diagrams are separate in JDeveloper. You can just choose to create a new sequence diagram from the menu - you can then drag java classes onto that diagram.


  • juan Friday, September 2, 2011

    Shay, you are correct that you can drag & drop the classes to the sequence diagram, but they don´t convert to object life line so they are useless in a sequence diagram. Instead, you have to add a object lifeline to the diagram, then go to prperties and select the class....this is not useful at all and I guess by your comment that there is no other way of doing this. For me, the way to go is that you drag and drop a class to the diagrama and it gets converted to object lifeline automatically.

    thanks anyway for answering

    Cheers


  • guest Thursday, October 13, 2011

    Hi,

    Thanks for the Demo. Can I create the diagram for a complete project? Say I have a Model project which consists of about 70 Java classes, split into different packages.

    Can I create a class / Collaboration diagram for these classes in a single drag-drop?


  • shay Thursday, October 13, 2011

    guest, you can shift+select all the classes in your application navigator and drag them all at once to a new diagram.

    There is currently no way to automatically create a diagram for a project without specifically selecting the classes.


  • guest Monday, May 28, 2012

    Hi Shay,

    thanks for short but really useful introduction into modeling with JDeveloper!

    I have a problem transforming physical class diagram to conceptual with the following exception:

    java.lang.IllegalArgumentException: Expected: L3::Interface



    at oracle.mof.generic.InstanceHandler.checkValid(InstanceHandler.java:73)

    at oracle.mof.generic.SingleValueAccessor.set(SingleValueAccessor.java:67)

    at oracle.mof.generic.GenericClass.set(GenericClass.java:603)

    at oracle.mof.generic.GenericObject.set(GenericObject.java:253)

    at oracle.mof.model.TransactionObject.set(TransactionObject.java:144)

    at oracle.uml.v2.umljava.transformation.UMLTransformationModel$UMLTransformationElement.setValue(UMLTransformationModel.java:1427)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.copyProperties(UMLJavaTransform.java:619)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transformRealization(UMLJavaTransform.java:311)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transform(UMLJavaTransform.java:277)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transformChildren(UMLJavaTransform.java:596)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transformClass(UMLJavaTransform.java:344)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transform(UMLJavaTransform.java:237)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transformChildren(UMLJavaTransform.java:596)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transformNamespace(UMLJavaTransform.java:414)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transform(UMLJavaTransform.java:286)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transformChildren(UMLJavaTransform.java:596)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transformNamespace(UMLJavaTransform.java:414)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transform(UMLJavaTransform.java:286)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transformChildren(UMLJavaTransform.java:596)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transformNamespace(UMLJavaTransform.java:414)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transform(UMLJavaTransform.java:286)

    at oracle.uml.v2.umljava.transformation.UMLJavaTransform.transform(UMLJavaTransform.java:158)

    at oracle.uml.v2.umljava.addin.UMLJavaTransformAddin$2.transform(UMLJavaTransformAddin.java:189)

    at oracle.bm.transform.TransformationManager$Transformation$1.construct(TransformationManager.java:329)

    at oracle.ide.util.SwingWorker$2.run(SwingWorker.java:132)

    at java.lang.Thread.run(Thread.java:619)

    Do you know what can cause this??? - any ideas would be really appreciated...

    Thanks and Best Regards,

    Yury


  • guest Friday, May 31, 2013

    THANK YOU VERY VERY VERY MUCH!!!


  • Ganesh Sunday, August 4, 2013

    This is just what I was looking for.

    Great post Shay. Thanks.


  • guest Tuesday, November 26, 2013

    wow nice


Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.