4 ms·
I think you've misunderstood the example code. Each instance of that Order class has exactly one product. There is neither a quantity to consider nor other item
by h2s 13y ago
I think you've misunderstood the example code. Each instance of that Order class has exactly one product. There is neither a quantity to consider nor other items in the cart. That may not be the same design as whatever ecommerce system you're used to, but it's definitely the design of this example.