Objects by Design Forums Here you can view your subscribed threads, work with private messages and edit your profile and preferences Registration is free! Calendar Find other members Frequently Asked Questions Search Home  
Objects by Design Forums : Powered by vBulletin version 2.3.5 Objects by Design Forums > Main Forums > UML Certification > relationships
  Last Thread   Next Thread
Author
Thread Post New Thread    Post A Reply
ankur.singla
Junior Member

Registered: Feb 2002
Location: delhi
Posts: 29

relationships

refer to code below

class library
{

public addBook(Book obj_Book)
{
..........................
..........................
..........................
}

public removeBook(Book obj_Book)
{

..........................
..........................
..........................
}
}

Is the relationship between library and book is dependency or of association ??

Report this post to a moderator | IP: Logged

Old Post 01-22-2003 03:28 AM
ankur.singla is offline Click Here to See the Profile for ankur.singla Click here to Send ankur.singla a Private Message Find more posts by ankur.singla Add ankur.singla to your buddy list Edit/Delete Message Reply w/Quote
Vikrama
Senior Member

Registered: Sep 2002
Location:
Posts: 101

Hi,
I think it's association.Remember association is a stronger from of dependency.

Bye,
Viki.

__________________
Count the flowers of ur garden,NOT the leafs which falls away!

Report this post to a moderator | IP: Logged

Old Post 01-22-2003 07:39 PM
Vikrama is offline Click Here to See the Profile for Vikrama Click here to Send Vikrama a Private Message Find more posts by Vikrama Add Vikrama to your buddy list Edit/Delete Message Reply w/Quote
Sanjay Mishra
Junior Member

Registered: Jan 2003
Location:
Posts: 8

Going by the definition and considering that the code is 'complete', it is parameter level dependency.

However, since we know the library well and know that book is 'contained' in the library, it is association (Check the association list: Book is contained in library).

Sanjay

Report this post to a moderator | IP: Logged

Old Post 01-23-2003 05:14 AM
Sanjay Mishra is offline Click Here to See the Profile for Sanjay Mishra Click here to Send Sanjay Mishra a Private Message Find more posts by Sanjay Mishra Add Sanjay Mishra to your buddy list Edit/Delete Message Reply w/Quote
KhurramSyed
Junior Member

Registered: Jan 2003
Location: Karachi,Pakistan
Posts: 2

Its Dependency. Looking at the code it seems that it is dependency but if we talk about real world it should be association.

Regards,

Khurram Mahmood.
Connect2web.com

Report this post to a moderator | IP: Logged

Old Post 01-29-2003 05:13 AM
KhurramSyed is offline Click Here to See the Profile for KhurramSyed Visit KhurramSyed's homepage! Find more posts by KhurramSyed Add KhurramSyed to your buddy list Edit/Delete Message Reply w/Quote
Vikrama
Senior Member

Registered: Sep 2002
Location:
Posts: 101

Hi,

quote:
Originally posted by KhurramSyed
... but if we talk about real world it should be association.
Connect2web.com



What do u mean by real world? I think OO is much about as we think in real world.So rejection/selection of OO features cannot be done on the basis of real world and non-real world.OO is all about real world.
Lastly, remember association is a stronger form of dependency, hence a dependency!

Bye,
Viki.

__________________
Count the flowers of ur garden,NOT the leafs which falls away!

Report this post to a moderator | IP: Logged

Old Post 01-30-2003 11:59 AM
Vikrama is offline Click Here to See the Profile for Vikrama Click here to Send Vikrama a Private Message Find more posts by Vikrama Add Vikrama to your buddy list Edit/Delete Message Reply w/Quote
yzhou
Junior Member

Registered: Jan 2003
Location:
Posts: 4

UML Distilled 2nd Edition says that this is dependence.
Because association must exist permanently for the life time of the involving objects, this excludes parameter association like the one given in the example.

Report this post to a moderator | IP: Logged

Old Post 01-31-2003 07:31 PM
yzhou is offline Click Here to See the Profile for yzhou Click here to Send yzhou a Private Message Find more posts by yzhou Add yzhou to your buddy list Edit/Delete Message Reply w/Quote
Vikrama
Senior Member

Registered: Sep 2002
Location:
Posts: 101

Hi,

quote:
Originally posted by yzhou
UML Distilled 2nd Edition says that this is dependence.
Because association must exist permanently for the life time of the involving objects, this excludes parameter association like the one given in the example.



Actually, one can't exactly say that either the given code has association or dependency relationship.We need full detail of code and developers opinion that how it will be going to use Book refernce that is either fot life time or temporary purpose.
Now as far as question is concern w.r.t exam 486 and we have to select either of association or dependency then i will go for association b/c it's a common observation that Library need and uses oftently Book, i.e life time.So a/c to good design Library must has association relationship with book.

Bye,
Viki.

__________________
Count the flowers of ur garden,NOT the leafs which falls away!

Report this post to a moderator | IP: Logged

Old Post 02-02-2003 09:16 PM
Vikrama is offline Click Here to See the Profile for Vikrama Click here to Send Vikrama a Private Message Find more posts by Vikrama Add Vikrama to your buddy list Edit/Delete Message Reply w/Quote
cejac63
Junior Member

Registered: Mar 2002
Location:
Posts: 20

This is a dependacy relationship.

Dependency relationship indicates that one element has knowledge of another element. In class diagrams the dependency relationship is useful to depict non-attribute visibility between classes, in other words, parameter, global, or locally declared visibility.

As you can see an object of the Book Class is a parameter of the public methods addBook and removeBook. The object will be a candidate for garbage collection at the termination of the methods.

It's been awhile, just thought I would drop in.

Craig

Report this post to a moderator | IP: Logged

Old Post 02-04-2003 03:13 PM
cejac63 is offline Click Here to See the Profile for cejac63 Find more posts by cejac63 Add cejac63 to your buddy list Edit/Delete Message Reply w/Quote
All times are GMT. The time now is 11:26 PM. Post New Thread    Post A Reply
  Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 

< Contact Us - Objects by Design >

Powered by: vBulletin Version 2.3.5
Copyright ©2000 - 2018, Jelsoft Enterprises Limited.
Copyright 1999-2005, Objects by Design, Inc.