Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

a Question from Whizlabs..

 
mallika shah
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
please help me here in a question.i am planning for the exam next week..

its from whizlabs
"
A graduate student works in a campus cafetaria as a cashier. he is enrolled as a full time graduate student and also works as a graduate teaching assistant in a elctrical engeneering department"

how will you design this description?
i mean if i were to design it what types of associations i were to use here..

thanks in advance

mallika
 
Marc Peabody
pie sneak
Sheriff
Posts: 4727
Mac Ruby VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1) You never said which exam this is for.
2) You never provided your thoughts on the question.

Otherwise, I'm sure many of us would be glad to help.
 
mallika shah
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
1.
i am sorry Marc for not referring the exam name...its for exam 486..OOAD with UML & patterns.

2.
according to me, as mentioned in whizlabs i understood its a composition inheritance heirarchy..
but i m a little confused about how to draw it using classes...
like which class composses what class?..what will be the interface name and which classes are implementing it...
i m agian writing the question..
"A graduate student works in a campus cafetaria as a cashier. he is enrolled as a full time graduate student and also works as a graduate teaching assistant in a elctrical engeneering department"


i hope now i have used the proper language to describe it...
hope you understand..

mallika
 
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper
Posts: 4968
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, I'll let you answer your own question, but one rule is that roles should always be implemented as interfaces.

While roles often can be seen as is-a type of relationships, the simply fact that a person can perform many roles, rules out inheritance, especially with a single inheritance system.

Can a cashier also be student? Can a student be a part time cashier? Can a professor take clases as well and be a student?

Program with interface.

Cheers!

-Cameron McKenzie
 
mallika shah
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Kameron..
i understood what you explained..

mallika
 
mallika shah
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
kameron, can i clear one more doubt ..

there is a relationship between Order class and a Customer..
multiplicity at Oder end-n
multiplicity at Customer end - 1

the role name on Customer side is recipient
now the code is here

class Order
{
private Customer recipient;
...
}

my question is can the role name in class diagram show public (+) and private (-) symbols?

if yes, then in whizlabs why for this code they have a diagram with recipient role name with a plus(+) sign instead of a "-" sign for private???


thanks
mallika
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic