n*****h 发帖数: 549 | 1 比如car rental system,
class customer里面应该有
send_rental_request()
相应的,
carRentalSystem里面应该有,
respond_request()
这两个function之间应该怎么联系起来? |
q****x 发帖数: 7404 | 2 system provides a public method for users to call. why need 2?
【在 n*****h 的大作中提到】 : 比如car rental system, : class customer里面应该有 : send_rental_request() : 相应的, : carRentalSystem里面应该有, : respond_request() : 这两个function之间应该怎么联系起来?
|
n*****h 发帖数: 549 | 3 So you are saying in each customer object it calls the CarRentalSystem? (
Most probably by newing it?)
【在 q****x 的大作中提到】 : system provides a public method for users to call. why need 2?
|
q****x 发帖数: 7404 | 4 class CarRental {
public:
bool getNewCar();
};
it's still CarRental's job to allocate resource.
【在 n*****h 的大作中提到】 : So you are saying in each customer object it calls the CarRentalSystem? ( : Most probably by newing it?)
|
n*****h 发帖数: 549 | 5 I see the point now.
【在 q****x 的大作中提到】 : class CarRental { : public: : bool getNewCar(); : }; : it's still CarRental's job to allocate resource.
|