Class diagram for Coreinterface #2BRL-CAD
Status: ClosedTime to complete: 96 hrs Mentors: Popescu Andrei, Daniel_RTags: research, OOP, UML, diagram

Coreinterface is BRL-CAD's object-oriented interface, that is offering application developers means to interact with BRL-CAD libraries, which are procedurally written(in C) in an OOP fashion.

You will need to draw an UML diagram of the primitive classes hierarchy in Coreinterface. When done, we will place it here http://brlcad.org/wiki/BRL-CAD%27s_core_C%2B%2B_interface

This is the Coreinterface repo : https://svn.code.sf.net/p/brlcad/code/rt^3/trunk/

In case you use tortoise SVN, you might need the link below: https://svn.code.sf.net/p/brlcad/code/rt%5E3/trunk/

References:
  • http://en.wikipedia.org/wiki/Class_diagram
  • https://svn.code.sf.net/p/brlcad/code/rt%5E3/trunk/
  • https://www.draw.io/
Uploaded Work
File name/URLFile sizeDate submitted
classdiagram.png129.2 KBJanuary 03 2015 12:12 UTC
diagramfixed.png14.0 KBJanuary 03 2015 18:40 UTC
corediagram.png38.8 KBJanuary 04 2015 00:04 UTC
XMLFormat.xml8.4 KBJanuary 04 2015 13:10 UTC
Comments
Marc Tannouson December 30 2014 08:11 UTCTask Claimed

I would like to work on this task.

Daniel_R on December 30 2014 08:23 UTCTask Assigned

This task has been assigned to Marc Tannous. You have 96 hours to complete this task, good luck!

Marc Tannouson December 30 2014 09:52 UTCPrimitive classes?

The other class diagram task was a bit more specific, asking for "database classes", here you're asking for "primitive classes". Does that mean classes defined on Cubes/Cones/Cylinders/Spheres/Tori/Tubes or basic classes?


My second question is : Should I look for them in /include/ or in /src/? I am grepping for keywords but if I grep the whole folder from root it returns thousands of calls.


Regards,


Marc


 

Daniel_R on December 30 2014 10:10 UTC

In this task's description there is a link to a brlcad.org wiki page.  There you will find a draft description of the class hiratchy.  The header files of the C++ classes can be found in rt^3/include/brlcad.

Daniel_R on January 2 2015 16:09 UTCDeadline extended

The deadline of the task has been extended with 2 days and 0 hours.

Marc Tannouson January 3 2015 12:16 UTCWhy this took so long

Initially, I started by writing down every method of each primitive, and the diagram got huge quickly, and this took lots of hours of work.


I asked d_rossberg over IRC whether what I am doing is alright and he said that I should not show methods of each primitives, just the "IS-A" relationship, not the "HAS-A" relationships, therefore getting this easy-to-read diagram that does not show the methods of each primitive ( because there are loads of them ). To get an idea of what the diagram started to look after the first few hours of work, I uploaded it to http://i.imgur.com/DnOIUzM.png , and this was surely not the expected result, a fact I realized a bit too late.


Regards,


Marc

Marc Tannouson January 3 2015 12:16 UTCReady for review

The work on this task is ready to be reviewed.

Daniel_R on January 3 2015 17:51 UTCNot bad

but you should



  • omit the methods and parameters of Object too (they are errors in it anyway),

  • rearrange the primitive classes such that the image can be included in a web page, and

  • draw the correct lines between the classes.


And, maybe, you could post the source from what you created the image too.


Some notes about "is-a" and "has-a": These are relationship types for classes.  Similar to Mazda 626 IS-A car and Mazda 626 HAS 4 wheels (which is a 1-to-4 HAS-A relation).  In case of the core C++ interface we have these relations for example as "Halfspace IS-AN Object" or "BagOfTriangles HAS (0 ... n) Faces".  This can be understood in the usual way: Halfspace has all properties of an Object.  In programming usually worded as "Halfspace inherits all properties from Object".  BagOfTrinangles is a container which contains other classes, the triangles (with class name Face).  In particular this is a 1-to-n relation here: 1 BagOfTrinangles can have n Faces.  When you write down this relation as a diagram this numbers arise on the corresponding arrow.


All this can be displayed in diagrams without mentioning any variable or method.  Only boxes with names representing the classes and arrows between the classes.


However, your focus is on the classes derived from Object and you should stay with it.  Fix the 3-4 points from the beginning of my comment and this task can be closed

Daniel_R on January 3 2015 17:51 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Marc Tannouson January 3 2015 18:37 UTCThank you for the clarifications

Having not worked with class diagrams before and this being my probably 3rd or 4th time ever working on something OOP-related ( the other times was when I did unit tests for CoreInterface ), I really needed the clarifications.


I fixed your requests, hope this is okay.


Regards,


Marc

Marc Tannouson January 3 2015 18:40 UTCRegarding the source

Data was collected from a local repo of rt^3, the diagram was created with the online program suggested in the reference of this task, draw.io . Easy, sleek and intuitive, it is so far the best option I've used for creating diagrams/flowcharts.


Regards,


Marc

Marc Tannouson January 3 2015 18:40 UTCReady for review

The work on this task is ready to be reviewed.

Daniel_R on January 3 2015 19:10 UTCSome issues


  • The arrows are wrong (direction and usually not filled).  See http://en.wikipedia.org/wiki/Class_diagram#Generalization

  • Rearrange the primitive classes such that the image fits nicely on a screen.  Maybe stairs-like?


Can the draw.io stuff be exported in a general file format?

Daniel_R on January 3 2015 19:10 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Marc Tannouson January 4 2015 00:06 UTCYes

Yes, the draw.io can be exported in loads of formats, usually xml.


- Used the arrows as shown on wikipedia.


- Resized it to fit nicely on a screen, the width is 1000px and it is still readable. Tried going the stairs-like approach but it seemed counter-intuitive, as if the primitives were not all childs of the same parent class, some of them being "higher".


Regards,


Marc

Marc Tannouson January 4 2015 00:06 UTCReady for review

The work on this task is ready to be reviewed.

Daniel_R on January 4 2015 13:02 UTCThe arrows are OK now

However, you should append one of the XML formats here too.  Take one which can be used to change/extend the diagram via draw.io.


Regarding your last point, all derived classes in your diagram are children of Object, non of them is higher than the other one in this sense.  Non of the primitives' classes is child or parent of another primitive's class.

Daniel_R on January 4 2015 13:02 UTCTask Needs More Work

One of the mentors has sent this task back for more work. Talk to the mentor(s) assigned to this task to satisfy the requirements needed to complete this task, submit your work again and mark the task as complete once you re-submit your work.

Daniel_R on January 4 2015 13:03 UTCDeadline extended

The deadline of the task has been extended with 1 days and 0 hours.

Marc Tannouson January 4 2015 13:10 UTCReady for review

The work on this task is ready to be reviewed.

Marc Tannouson January 4 2015 13:11 UTCXML Submitted

XML file format submitted, however not with the "IS-A" arrows as draw.io does not have those, they were manually added in Photoshop. It has normal arrows.

Daniel_R on January 4 2015 15:40 UTCI've just tried draw.io

and it was very easy to change the arrows to the right ones and to rearrange the boxes such that they are more compact.


Nevertheless I'll close this task.

Daniel_R on January 4 2015 15:41 UTCTask Closed

Congratulations, this task has been completed successfully.