Jump to content
  • Advertisement
Sign in to follow this  
Sijmen

Trying to make a class diagram - problem

This topic is 5469 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi all. I'm trying to make a class diagram (of which some classes are already implemented) of a client-server game. Using Visio, I made this diagram: Click for larger version! The problem is the following: I have a GameData class, which contains all the game data. This class and the references can be obtained trough the network. This makes that I have two references to the class: - ServerApp->GameData (as official source) - ClientGame->GameData (local copy) Also, the object is synchronised over the network. How is my visualization? I find this kind of hard to explain and/or visualize.

Share this post


Link to post
Share on other sites
Advertisement
Did Visio generate this straight from code?

The only thing that throws me is the lack of arrowheads for the Association links (solid lines). If there isn't an arrowhead there should at least be something to let you know the direction of the association (unidirectional or bidirectional).

I've never had good results from Visio. You might want to look into Enterprise Architect instead

Share this post


Link to post
Share on other sites
Well, I got this version of Visio free, because I'm a student. And indeed, there are no arrowheads (yet), neither is the diagram generated from source. I'm just wondering if this is a good way to visualize 3 connections to the GameData class, one for the server copy, one of the client copy, and one trough the network.

Share this post


Link to post
Share on other sites
Quote:

Did Visio generate this straight from code?

The only thing that throws me is the lack of arrowheads for the Association links (solid lines). If there isn't an arrowhead there should at least be something to let you know the direction of the association (unidirectional or bidirectional).

I've never had good results from Visio. You might want to look into Enterprise Architect instead


Bidirectional associations are without arrowheads. Poseidon UML does this too. I am inclined to believe this is the correct UML syntax. Poseidon has an arrowhead for unidirectional associations. However, both my UML book as a number of webreferences use a line without arrowheads with a multiplicity on only one side to indicate a unidirectional association.
The multiplicities in this diagram on every side of the lines also imply that this is a bidirectional association.
Either way, it's unclear.

To answer the original question, yes, I think it's clear that both a client as a server have an instance of GameData.
It is not clear who holds the official source and who owns the copy.
Your classdiagram is meant to describe the static structure of your application. So there is no way of modelling who would hold an original source or a copy because you can not identify seperate instances of one class. That would fall under dynamic behaviour.
In the overall picture of dynamic behaviour there would be an instance of GameData on the server side (the original source) and there would be an instance of GameData on the client side (the copy). Dynamic behaviour is usually modelled with a sequence duagram.

Share this post


Link to post
Share on other sites
Ok, thanks.

By the way, how to add arrowheads with Visio? I tried using the arrow button from the toolbar, but it doesn't work that way. Probably, there is some offcial way.. any ideas?

Share this post


Link to post
Share on other sites
If your interested in automatic UML generation from source code (you could even write skeleton source code purely to produce the diagrams), doxygen can produce class diagrams and collaboration diagrams using Graphviz (a program which automatically lays out graphs so that they look nice). If you're working on a large project, this a fantastic way to keep your source code and documentation effortlessly syncronized.

Share this post


Link to post
Share on other sites
Great, I'll certainly look into that!

Also, what do you all think of the design itself? Are there things which I should change?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!