You don’t need to inject anything. I just demonstrated an example where you use the parameter in
init. In fact, you can use without the parameter in
init method. Also, if you use the example in my previous comment, you’ll know that
dueDate is required. Because every
Product object have to conform
ProductDueProtocol. In some other cases, you don’t…
Thanks! I’m glad that you liked it. Your feedback is really valuable!
Yes, indeed it’s an overview to give more focus on the generics itself instead of the implementation.
In my point of view, having a parameter in the
Product.Type enables us the create the product in the correct type. So, your…