473,399 Members | 3,401 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 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 2429
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...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.