Once the instance is constructed, you can call the invoice and manifest functions on your PurchaseOrder object, which uses the implementations provided in the defrecord.
一旦构造了实例,您就可以在您的 PurchaseOrder 对象上调用 invoice 和 manifest 函数,其使用在 defrecord 中提供的实现。
I've cut out all of the HTML markup code here for brevity; you can see it in the Invoice.
为了简单明了我已经删掉了此处所有的 HTML 标记代码;
And with that, you have polymorphic invoice and manifest functions that can be called on either an Order or a Contract and that will do the right thing.
就这样,您具有多态invoice和manifest函数,可以在一个Order或一个Contract上调用且作出正确操作。
应用推荐