Results 1 to 10 of 10
  1. #1
    kevinkhan is offline Member
    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0

    Default Association Classes for these classes

    Can anyone help me to answer this question

    Add association classes to the three many-to-many associations in the following diagrams. Show attributes that might be found in these association classes


    i) Player ---------- SportsGame
    ii) Spectator --------- Show
    iii) Guest --------- Hotel Room


    Thanks for any help given

  2. #2
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: Association Classes for these classes

    What do you think the answers are?
    Unless you were expecting someone to do your homework for you.
    Please do not ask for code as refusal often offends.

  3. #3
    kevinkhan is offline Member
    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0

    Default Re: Association Classes for these classes

    well this is what i came up with myself but i dont think they are the best solutions.


    i) Registers[season,Title,…]
    ii) Showing[Time, Date,…]
    iii) Stay/Visit[StartDate, Duration]

  4. #4
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: Association Classes for these classes

    How are those associating the left hand side with the right hand side?
    Please do not ask for code as refusal often offends.

  5. #5
    kevinkhan is offline Member
    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0

    Default Re: Association Classes for these classes

    im not sure. im new to all this. that is why i am posting here. to get some help.

  6. #6
    kevinkhan is offline Member
    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0

    Default Re: Association Classes for these classes

    can anyone help me out? :(

  7. #7
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: Association Classes for these classes

    Taking the first one.
    You have a Player.
    That Player can play in many Games.
    In addition each Game can have many Players.
    That's your many-to-many association.

    The association class in between is a mapping between a single Player and a single Game.
    So it needs attributes that allow it to identify which Player and which Game.
    Please do not ask for code as refusal often offends.

  8. #8
    kevinkhan is offline Member
    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0

    Default Re: Association Classes for these classes

    Ok so i could call this class Plays

    with attributes like playerName and nameOfGame?

    would this be ok?

  9. #9
    Tolls is offline Moderator
    Join Date
    Apr 2009
    Posts
    11,442
    Rep Power
    18

    Default Re: Association Classes for these classes

    That looks about right to me.
    Please do not ask for code as refusal often offends.

  10. #10
    kevinkhan is offline Member
    Join Date
    Nov 2011
    Posts
    13
    Rep Power
    0

    Default Re: Association Classes for these classes

    ok thanks for your help..

Similar Threads

  1. Classes Help!!! two classes with object question.
    By stuckonjava in forum New To Java
    Replies: 16
    Last Post: 02-10-2012, 01:39 AM
  2. Use classes inside of other classes
    By BlankFile in forum New To Java
    Replies: 2
    Last Post: 02-06-2012, 01:51 PM
  3. Three classes help!!
    By arrech326 in forum New To Java
    Replies: 4
    Last Post: 11-24-2009, 06:34 AM
  4. Help with classes
    By gnarly hogie in forum New To Java
    Replies: 14
    Last Post: 10-10-2008, 02:29 PM
  5. Cant run my classes
    By Assaf A in forum Eclipse
    Replies: 1
    Last Post: 04-22-2008, 02:31 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •