• In this case, you could avoid the conditional logic by overloading the invoice method for different types.

    在本例中,通过为不同类型重载invoice方法,您可以避免条件逻辑。

    youdao

  • If you define an invoice method on a class, you have no way of knowing that some other user of that class won't define a different, incompatible method also named invoice.

    如果您在类上定义invoice方法,则您没有办法知道该类的一些其他用户会不会定义不同的、不兼容的方法,还命名为invoice。

    youdao

  • And this implementation is closed: After you compile the FulfillmentGenerator class, you can't extend the invoice method to new types without editing the source code and recompiling.

    此实现是封闭的:在您编译FulfillmentGenerator类以后,在不编辑源代码和重新编译的情况下,您无法将invoice方法扩展到新的类型。

    youdao

  • And this implementation is closed: After you compile the FulfillmentGenerator class, you can't extend the invoice method to new types without editing the source code and recompiling.

    此实现是封闭的:在您编译FulfillmentGenerator类以后,在不编辑源代码和重新编译的情况下,您无法将invoice方法扩展到新的类型。

    youdao

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定