Re: dispatchers knowledge when placing trucks in array


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]

Posted by AG on December 02, 2001 at 22:59:26:

In Reply to: dispatchers knowledge when placing trucks in array posted by Jason on December 02, 2001 at 21:12:36:

the dispatcher just has an array of trucks...it doesn't need to know what truck it is adding. thats where the polymorphism comes in. and since the carHandle functions are different for the 3 types, there shouldnt really be any prob.
hope i helped.


: Is it alright for the dispatcher to know what kind of can the dispatcher know what type tow truck it is placing into the array of trucks?

: For example in the dispatcher class I have 3 fuctions
: add_truckToList(hauler a_hauler);
: add_truckToList(mover a_mover);
: add_truckToList(wrecker a_wrecker);

: And in these functions I place the the tow truck into my list of type towtruck. Is the dispatcher not allowed to know hauler, mover, and wrecker types exist?




Follow Ups:



Post a Followup

Name:
E-Mail:

Subject:

Comments:

Optional Link URL:
Link Title:
Optional Image URL:


[ Follow Ups ] [ Post Followup ] [ CS2704 Web Discussion Board ] [ FAQ ]