MiscWorld

A MiscWorld Experience

Welcome Back!

MiscWorld: A good place for computer geeks... and a little something for the rest of you.

 

UML: Association, Aggregation and Composition

This seems like the neverending story, and because I’m tired of it I want to share my understanding:

  • Association: Used when one instance should send a message to another instance. There’s no a whole / part relationship. In Java this can be an instance calling another instance’s methods. Examples of this can be a Customer and its persistance mechanism (DAO - data access object). They just send messages between each other.
  • Aggregation: Used to represent a whole / part relationship. The creation and destruction of child objects is not controlled by their parent. For example, a Binder and its sheets. You can destroy your binder and save your sheets for later usage… or for another binder.
  • Composition: Like an aggregation but the life span of child objects is controlled by their parent. For example, a Notebook and its sheets… If you create a notebook, you need to create sheets to fill it with. If you destroy your notebook you will destroy all your sheets. You know you have a composition when you no longer need the child objects once the parent has been destroyed.
Digg this

15 Comments so far

  1. Your Reader January 27th, 2009 3:51 pm

    Good work! Thank you very much!
    I always wanted to write in my site something like that. Can I take part of your post to my blog?
    Of course, I will add backlink?

    Sincerely, Timur I.

  2. oxyloalia February 4th, 2009 4:05 pm

    Hi there

    If anyone knows or provide..

    I need UK VPN account.. (to bypass unblock etc..)

    I already have USA vpn account..

    I dont want to provide vpn service..

    I want to buy and enjoy one..

  3. oxyloalia February 5th, 2009 4:07 pm

    Hi. Your site displays incorrectly in Mozilla, but content excellent! Thanks for your wise words:)

  4. andres February 5th, 2009 4:23 pm

    Hi oxyloalia! and thanks for your comment!

    Would you please let me know what Mozilla browser you have?

  5. bestdisk March 14th, 2009 10:17 am

    If Timur it is possible, also I will take, I will place here best-disk.ru

  6. watch-s March 17th, 2009 8:56 am

    Thanks for an interesting post, I wait for continuation
    ___________________________________

  7. v-rem March 20th, 2009 2:42 am

    The actual information, thanks, I will take to myself here http://v-rem.ru the reference to you I will put

  8. onlykats March 20th, 2009 7:52 am

    Here and I about the same write here onlykats.ru

  9. JaneRadriges June 13th, 2009 2:19 pm

    Hi, interest post. I’ll write you later about few questions!

  10. KattyBlackyard June 14th, 2009 6:13 pm

    The article is usefull for me. I’ll be coming back to your blog.

  11. GarykPatton June 15th, 2009 7:38 pm

    Hello. I think the article is really interesting. I am even interested in reading more. How soon will you update your blog?

  12. Vervelurroura July 2nd, 2009 12:55 pm

    Your blog is so interesting! I have subscribed on rss and I will read it regullary/

  13. Soloplonsot July 3rd, 2009 5:39 am

    Very interesting blog! Subscribed on rss. Regular will read it

  14. CrisBetewsky July 6th, 2009 1:05 pm

    It’s a masterpiece. I have never thought people can have such ideas and thoughts. You are great.

  15. KonstantinMiller July 6th, 2009 1:15 pm

    How soon will you update your blog? I’m interested in reading some more information on this issue.

Leave a reply