473,657 Members | 2,414 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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>::myDat aType 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 2451
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>::myDat aType 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
1690
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 in a form, packages it, and sends it on to an external server. The external server will then send back the response via http to my server script. But not the same script. And there is the rub, I don't know how the second script can get to my user.
20
2356
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 (Employees), and the other is an Address File (Addresses) linked by SSN. I've set Addresses as a Lookup Table - If the user starts typing in the SSN it should pull up the Employees records. I'm getting stuck in the Data Entry form. When I type in...
6
2111
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 responsible for instantiating the orders class? Would it be the ui layer or the master class in the business layer? thanks,
14
1829
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 ????? OK, this function may return a boolean, and if this is true, then no message back is really required, but if it fails then some supporting message needs to be returned to the calling code. As I see it there are a few options.
2
2385
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 suffix ID where 1=Phd, 2= MD. To display all of these to the user, I created a form with an underlying query. The problem I am encountering is this, when we have an empty field, for example where ID="", the query returns nothing. How do i work around...
2
1231
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 sections, or categories if you will, about a client. For instance, some clients have data regarding our Estate Planning section, some clients have data regarding our Real Estate section, etc. Would it be better to have one object that...
0
1482
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 thing they have set it up with doesn't work when I call it from an external program (including .bat files). when I call it outside of spe I manage to just get a box without the tracker part. It is so close to out right theft I was hopeing I...
12
7000
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 foreign Key relationship or does this always indicate some sort of underlying design flaw. Something that requires a re evaluation of the problem domain? The reason I ask is because in our application, the user can perform x
5
2881
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 define the structure of an xml document, and to validate that a particular document conforms to the schema. They can also be used to transform the document, by filling in missing attributes with default values.
0
8402
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8734
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8508
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8608
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6172
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5633
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4164
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4323
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
1962
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.