• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

a Question from Whizlabs..

 
Ranch Hand
Posts: 164
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
pie sneak
Posts: 4727
Mac VI Editor Ruby
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic