13 responses

  1. Mario Guerrero
    December 30, 2012

    Very good and cler.


  2. george
    January 7, 2013

    Nice post, easy to dive into the main concepts. If class diagrams are just a subset of UML, they are commonly used to design/describe most of our domain models (i.e the handled data), even if the whole system (processes, use cases…) is not modeled. That’s why it’s pretty cool to learn class modeling from the developer’s point of view: with a basic implementation in Java.

    For those who want to create an UML class diagram online and to get the corresponding Java code, I recently discovered genmymodel (http://www.genmymodel.com). It’s in beta but already allows to make a class diagram/model (not only a drawing), and to generate code from it. It makes sense for further reading.


    • Mainak
      January 9, 2013

      Hello George,

      I explored the genmymodel.com website and I must say this is a very nice initiative. Good luck.

  3. Joseph
    March 21, 2013

    Hey, It is very nice to learn UML diagrams with Java examples.
    Aggregation and Composition can you give much clear example…?

  4. Ganesh
    April 17, 2013

    Very nice exploration and very very use for Us. thanks

  5. mallikarjun
    May 17, 2013

    Nice Post all…Thanks for u r service….This kind of explanation is usefull for both learners and experienced persons also…
    Why don’t u provide explanation on other design patterns all structural and behavioural and j2ee design patterns this is will be really help full..

    • IdioTechie
      May 18, 2013

      Thanks Mallikarjun for your interest. I will be writing on few other design patterns shortly. Keep watching this space.

  6. Maher
    July 13, 2013

    Thanks Idio Techie very usefull explanation , i have some other cases i don’t know how te depict them in an class diagram, if you can help me :

    1) A class that extends from an imported class , below is an exemple code :

    package Mypackage;

    import javolution.xml.XMLBinding;

    public class SctpXMLBinding extends XMLBinding {


    2) How to represent two classes that have association relation and dependency relation at the same time

    exemple code

    public class A { }

    public final Class B {

    private A That_class;

    protected B ( A That_class ) {
    this.That_class = That_class ;


    3) How to represent a class that has an association with an imported class :

    import javolution.text.TextBuilder;

    public my_class {

    private final TextBuilder persistFile = TextBuilder.newInstance();

    public my_class() { }


    Thanks in advance

    • IdioTechie
      July 15, 2013

      Hello Maher.
      Thanks for visiting our website. Please find below the answers to your above query:
      1) This is a straight forward Generalization. Even if the class is imported you are using extend keyword to inherit from XMLBinding.
      2) In this case the association gets more priority over dependency. Dependency is more generic and association is more specific and stronger type relationship. So you will need to use association diagram here.
      3) This is again an association relationship. You can refer this to my example of Car which is associated to the Customer through owner. Similarly my_class is associated to the TextBuilder class through persistFile.
      Hope this helps.

      Please keep visiting this space for more article and don’t forget to subscribe to our newsletter.

  7. Sushant
    September 3, 2013

    Good article,concepts are very nicely explained

  8. Fábio Pagoti
    December 24, 2013

    Hi IdioTechie!

    Congratulations for your post! There are many pages on google which seems to have such kind of information but yours is unique. You were the only to show code AND uml diagrams. Moreover the only one who focused on associations and other relationships between classes and interfaces. The rest just show visibility levels, attributes and methods :-(

    This content will be priceless for me as I’m developing a tool to transform ABAP code to UML diagrams using yUML.


    Thanks again and merry Xmas.

    • IdioTechie
      December 25, 2013

      Thanks Fabio for your feedback. Appreciate it.
      Wish you the same and please keep visiting this website and provide your feedback for further improvements.

  9. dhia
    January 2, 2014

    nice post..Tq

Leave a Reply




Back to top
mobile desktop