472,805 Members | 1,703 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,805 software developers and data experts.

Question regarding a very simple UML diagram

Hi everybody,
I am supposed to draw a simple UML diagram for a very small project that
consists of less than a dozen classes. I have never been working with
UML before, I have read some tutorials but I cannot find the connection
between UML and my C++ code.

What I have found out so far is that inheritance is indicated by an
arrow like this

|\
------| >
|/

But I am not quite sure what type of connection is required between two
classes that are related the follwing way:

class myDataType
{
int foo;
...
}
class listElement
{
myDataType bar;
...
}

This is not what I would call inheritance so I assume that there is a
different type of connector. Does anybody have a clue of how to connect
these two classes in an UML diagram? I believe it could be similar to
this, but I am not really sure:

<>----------->

What would be the difference in an UML diagram if the second class would
be using a vector like that:

class listElement
{
<vector>::myDataType bar;
}

Maybe someone can recommend a _good_ UML tutorial that explains the
basics of UML in a way that is related to C++, all tutorials I found so
far are only rubbish.

Thanks in advance!
Oskar

PS.: Does anybody know a good tool for drawing UML diagrams? I just have
tried out dia but it is not very comfortable to use.
Apr 30 '07 #1
1 2370
On May 1, 5:05 am, Oskar Bennet <mr_mil...@gmx.netwrote:
Hi everybody,
I am supposed to draw a simple UML diagram for a very small project that
consists of less than a dozen classes. I have never been working with
UML before, I have read some tutorials but I cannot find the connection
between UML and my C++ code.

What I have found out so far is that inheritance is indicated by an
arrow like this

|\
------| >
|/
Yes that's right. But the line can be solid or dashed and there is a
difference in meaning which I can't remember off the top of my head.
But I am not quite sure what type of connection is required between two
classes that are related the follwing way:

class myDataType
{
int foo;
...

}

class listElement
{
myDataType bar;
...

}

This is not what I would call inheritance so I assume that there is a
different type of connector. Does anybody have a clue of how to connect
these two classes in an UML diagram? I believe it could be similar to
this, but I am not really sure:

<>----------->
It's a one way relation with aggregation. It is a logical choice for
what you have for bar above.
>
What would be the difference in an UML diagram if the second class would
be using a vector like that:

class listElement
{
<vector>::myDataType bar;

}
You can put in parametrised types but I can never remember the UML
syntax so I tend to use C++ syntax for the type. I would have an
attribute that looked like this:

bar : std::vector< myDataType >
>
Maybe someone can recommend a _good_ UML tutorial that explains the
basics of UML in a way that is related to C++, all tutorials I found so
far are only rubbish.
I have some UML diagrams with explanations on my web site. They're not
intended for use as a tutorial but I do describe what the notation
means. There aren't that many right now, but I do add new ones from
time to time.

http://www.kirit.com/Categories:/UML

There are two important points to remember about UML. The first is
that the formal semantics is only a starting point and you will
probably end up making your own notation on top of UML. The second
comes from that first and is that UML doesn't describe the C++ that
you will write, the C++ source does that. The UML is a logical
structure of the code. There is no requirement that there be a one-to-
one mapping between UML classes and C++ class, UML attributes and C++
attributes etc.

When I write UML I am writing a simplified, but accurate abstraction
of the design of a system. Most of the classes in the UML that
represent logical business classes for an application will result in
up to half a dozen actual C++ classes.
PS.: Does anybody know a good tool for drawing UML diagrams? I just have
tried out dia but it is not very comfortable to use.
I use Rational Rose which is good but very pricey. Google StarUML
which made a good first impression on me, but I couldn't work out how
to annotate the diagram with the extra meta-data I need to drive my
UML compiler.
K

May 1 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Tigerhillside | last post by:
I forgot I had a "real" newsreader available. So here is the question you will see "soon" when google decides to post my other question. I have a server side script that takes a user's input...
20
by: Jack Schitt | last post by:
I thought I was starting to get a handle on Access, until I tried doing something useful...now I'm stuck. I have a DB with two tables - to keep it simple I'll say that one is an Employee File...
6
by: rodchar | last post by:
Hey all, I'm trying to understand Master/Detail concepts in VB.NET. If I do a data adapter fill for both customer and orders from Northwind where should that dataset live? What client is...
14
by: Mr Newbie | last post by:
I am often in the situation where I want to act on the result of a function, but a simple boolean is not enough. For example, I may have a function called isAuthorised ( User, Action ) as ?????...
2
by: Fendi Baba | last post by:
I created a person table with various fields such as Suffix, Salutation, etc, Some of these fields may not be mandatory for example suffix. In the actual table itself, I only have a field for...
2
by: et | last post by:
I am new to asp.net. I am writing a program that will revolve around an extensive client database, and wonder what the best way to design the program is, using classes. I have about 10 different...
0
by: Eric_Dexter | last post by:
I know this might be the wrong place to ask but I recently modified the ogl example from wxpython and it works fine in spe but when I call it from other programs it wierds out because of the run.py...
12
by: nyathancha | last post by:
Hi, I have a question regarding best practices in database design. In a relational database, is it wise/necessary to sometimes create tables that are not related to other tables through a...
5
by: Frank Millman | last post by:
Hi all This is not strictly a Python question, but as I am writing in Python, and as I know there are some XML gurus on this list, I hope it is appropriate here. XML-schemas are used to...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 2 August 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
0
by: Taofi | last post by:
I try to insert a new record but the error message says the number of query names and destination fields are not the same This are my field names ID, Budgeted, Actual, Status and Differences ...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.