Avatar billede fredand Forsker
15. april 2003 - 14:57 Der er 7 kommentarer og
1 løsning

Java and UML

Hello!

I still try to map UML to Java.

I really would like som comments at this table at:
http://medlem.spray.se/fredand44/umltable.html

I have used this sites (and friends) to understand have the mapping should be.

http://ootips.org/uml-hasa.html
http://www.holub.com/goodies/uml/index.html

Best regards
Fredrik
Avatar billede arne_v Ekspert
15. april 2003 - 15:07 #1
I think I have already commented on this before.
Avatar billede arne_v Ekspert
15. april 2003 - 15:13 #2
To me:

aggregation =

public class ClassA
{
    private ClassB classB;

    public ClassA(ClassB classB)
    {
        this.classB = classB;
    }
}

public class ClassB
{
}

[like yours just so that compositiona nd aggregation is mutually exclusive]

composition:

class ClassA
{
    private ClassB classB;

    public ClassA()
    {
        classB = new ClassB();
    }
}

class ClassB
{
}

[exactly like yours]

association = any reference between ClassA and ClassB
including both aggregation and composition.

[like yours]

dependency = any use of ClassB in ClassA

[exactly like yours]
Avatar billede fredand Forsker
15. april 2003 - 15:45 #3
Hello!

Can you explaine what you mean with:
[like yours just so that composition and aggregation is mutually exclusive]
...more in detail.

Would you agree to this inheritance for the relations then (this is a long shoot).
http://medlem.spray.se/fredand44/relationsships.jpg

Bets regards Fredrik
Avatar billede arne_v Ekspert
15. april 2003 - 15:50 #4
It is my understanding that composition and aggregation is mutually exclusive.

So if A has a refernce to B it is either a composition or and
aggregation.

If other objects can have a reference too it is an aggregation.
If not it is a composition.
Avatar billede arne_v Ekspert
15. april 2003 - 15:54 #5
That is also how I view it.

That does not guarantee that it is correct. Just that you are not
the only one believing it.

BTW, there are one thing and that is the arrows. They indicate
navigation.

And there are several possibilities and that is somewhat separate
from the dependenct/association/aggregation/composition discussion.
Avatar billede fredand Forsker
16. april 2003 - 16:46 #6
Hello Arne!

Give my an answer so I can get you your points

Fredrik
Avatar billede arne_v Ekspert
16. april 2003 - 16:49 #7
OK

[even though I am note sure that I have contributed so much]
Avatar billede fredand Forsker
16. april 2003 - 16:57 #8
See ya!
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester