This week's book giveaway is in the Cloud forum.
We're giving away four copies of The Business Blockchain and have William Mougayar on-line!
See this thread for details.
Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

relationships - class diagrams

 
ravi appala
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi can anyone comment on this! Appreciate if SCEA's also took part!
If we a class 'a' has application relation with another class 'b',but class 'a'/'b' does not have any any of it's attributes of other,defined in the definetion. Can we still show them as assoiciated?
[Andrew: took out Fly By Night Services specific example]
I am sorry If I confused you, if you guys need more info, i can give.
I am bit confused when to really show association? should i show diectional always? I read many books, but I understand the examples, but could not see any which relates to the above?
Thanks,
ravi
[ November 01, 2003: Message edited by: Andrew Monkhouse ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ravi,
Sorry, but I had to take out your specific example - we do not allow questions / answers on the real assignment. You can find out why in the topic: "IMPORTANT - Position on real assignment (Part 2) questions".
As to your question - I think it is important that we as architects find how the various classes are related. If we don't know, then how is the poor programmer going to implement this?
When we find out how the classes are related, we may find that it is just some attributes that are missing from our class diagram, or we may find that there is an entire class missing.
Note that this does not necessarily mean that we have to show the attributes that we discover - but we do have to find them out.
Regards, Andrew
 
ravi appala
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Andrew, I mentioned in my example, that the attributes are not missing but they are functionally related, i wanted to know if we can associate classes thoese really does not have attricutes of each other but they are related?
I am sorry if you feel that is more assignment specific,but i mentioned in my example in general, and just to understand i applied one example.
I hope you understand my itention!
Thanks,
ravi
 
noel angel
Ranch Hand
Posts: 75
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ravi,
If you have a class that merly uses the services of another class you do not show it in an association or on a class diagram. for example:
I take a book out of the library on a date. The lendable object is associated with a specific date object called the due date which is a member of the lendable object. I may also use the Date class to obtain the string representation of the date to use for a report given nightly to the librarian which shows the books taken out that day. This is not an association only a uses relationship which we do not need to show on a class diagram. There is no semi-permanent relationship between the Date class and the report class. There is between the lendable and the due date!
There are many classes that fit into the non-associated just used category. I reversed engineered Sun's Pet store example and was very surprised how many non associated classes there are. All of the exception classes for example are used when needed not associated. Many of the factory classes are associated only to the DAO they create not the rest of the class diagram, so once they create their representative DAO's they out of stuff until they are needed again. They are associated to those DAO's however.

Noel
SCJP, SCWCD, SCEA(Part 1)
 
ravi appala
Ranch Hand
Posts: 35
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for ur reply. I also reverse engineered the pestore long back. There are many look up objects, many those are associated few, many few associated are left alone. If we look at any other class diagrams as examples provided by architect expters in the books, many of them they show all of the classes some how related.
I am trying to learn the better way instead of just certification, that is why I did open this topic for open discussion.
Thanks again!
Ravi
 
Andy Chow
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Conceptually, uses is also an association. I think the Date object do have an association with the lendable object, but depends on the level of details you want to show on your class diagram, most of the time they are left out.
In the case of reverse engineering the pet store ... in the implementation you would definitely found much less association (as in object creation and aggregation sense) because of performance and partical design and implementation reasons. As in your example, DueDate will just be an attribute to the lendable object in the actual implementation.
As for the books ... the author will want to illustrates the concepts and that is why they kind of take the highest details possible.
This is only my 2cents
Andy

Originally posted by noel angel:
Hi Ravi,
If you have a class that merly uses the services of another class you do not show it in an association or on a class diagram. for example:
I take a book out of the library on a date. The lendable object is associated with a specific date object called the due date which is a member of the lendable object. I may also use the Date class to obtain the string representation of the date to use for a report given nightly to the librarian which shows the books taken out that day. This is not an association only a uses relationship which we do not need to show on a class diagram. There is no semi-permanent relationship between the Date class and the report class. There is between the lendable and the due date!
There are many classes that fit into the non-associated just used category. I reversed engineered Sun's Pet store example and was very surprised how many non associated classes there are. All of the exception classes for example are used when needed not associated. Many of the factory classes are associated only to the DAO they create not the rest of the class diagram, so once they create their representative DAO's they out of stuff until they are needed again. They are associated to those DAO's however.

Noel
SCJP, SCWCD, SCEA(Part 1)

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic