Menu

Relation with a key

SpaceToto
2006-07-27
2013-04-17
  • SpaceToto

    SpaceToto - 2006-07-27

    I've just started to use ClassBuilder and it seems very powerfull.

    I would like to do a relation with a key. And this relation shoud be implemented by a std::map<keyType,keyValue>. How can i do this ?

    I think that i must write it in the source and make a "diagram only relation".

    Any one has allready done this ?

     
    • John van der Kist

      There are at least 3 ways to implement the relation you want:
      1) use the CB relations ((unique) value tree or AVL tree). This gives you all the benefits that CB has to offer.
      2) use the STL library. You can download the STD.CBD library from the website where the STL templates have been defined as External Classes.
      3) write your own if you think that none of the above is appropriate

      Hope this helps.

      John

       
    • Anonymous

      Anonymous - 2007-11-18

      [Note that I did not create this thread.]

      Will all those ways work for creating a class diagram that shows the relation?

      More specifically, if I use STL.cbd to create a member with type "std::map<keyType,keyValue>" where the key and/or value is a class, then will the class diagram show the relation automaticaly (assuming the relevant classes are selected for the diagram)?

      I will try doing that; I did not understand ClassBuilder well enough when I first tried doing something like that. If someone can verify that it is possible, then I will figure it out.

      I personally don't use graphics such as class diagrams as much as most people, but I am working on some objects (of my own design) that are related in ways I am having difficulty keeping in my head, so I am hoping ClassBuilder will help. Initially, it appeared to me that I had to have duplicate relations, one for ClassBuilder (that does not get represented in code) and another that does represent code and that is generated when code is generated.

       
      • John van der Kist

        The only things that CB can show in the class diagrams are:
        - classes including member functions and variables
        - notes
        - inheritance relations
        - ClassBuilder-defined relations
        - dependencies
        - diagram-only relations

        The last option may be your way out. The diagram-only relation draws like any other relation, but no code is being generated. It is just a reminder that a relation exists that CB knows nothing about.
        I hope this helps.

        Regards,

        John

         

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.