user4911: In the auction example (Class 2), the endpoint for Grab just only requires the Wallet as parameter. The wallet and the validator will retrieve all UTxOs for that wallet that are available (past their deadline).
In class 3 example, now there cannot be a grabAll endpoint because the deadline is a parameter, so I did not see a benefit in this approach, please enlighten me.
Can you please provide more examples where this is actually useful?

user5556: In class 3 example, now there cannot be a grabAll endpoint because the 
deadline is a parameter, so I did not see a benefit in this approach, 
please enlighten me.

Can you please provide more examples where this is actually useful?

As you said, the deadline is the parameter and as I understand it one can actually 'grabAll' as long as the deadline parameter of that particular grab is after all the deadlines specified by the gifts.
I think the example is useful in cases if you want to stagger the redemption of the gifts by beneficiaries into different deadlines or slots or specific times.

user382: The benefit is limiting scope of addresses to scan to the beneficiary (and deadline). The reason you'd want to do this is say 1 million people are using this contract. Someone redeeming would need to filter through millions of utxos with the first approach but in the second only has to look at utxos associated with them. The homework switching this to 50/50 approach takes the best of both worlds. All utxos found are for the beneficiary but then you can filter on the datum for all transactions that are vested to redeem.

user5689: Here is a real example on Cardano mainnet and how one of the decentralized exchanges uses it. https://twitter.com/adax_pro/status/1488524779686608903


4911: <p>In the auction example (Class 2), the endpoint for Grab just only requires the Wallet as parameter. The wallet and the validator will retrieve all UTxOs for that wallet that are available (past their deadline).</p>
<p>In class 3 example, now there cannot be a grabAll endpoint because the deadline is a parameter, so I did not see a benefit in this approach, please enlighten me.</p>
<p>Can you please provide more examples where this is actually useful?</p>
 5556: <pre><code>In class 3 example, now there cannot be a grabAll endpoint because the 
deadline is a parameter, so I did not see a benefit in this approach, 
please enlighten me.

Can you please provide more examples where this is actually useful?
</code></pre>
<p>As you said, the deadline is the parameter and as I understand it one can actually 'grabAll' as long as the deadline parameter of that particular grab is after all the deadlines specified by the gifts.</p>
<p>I think the example is useful in cases if you want to stagger the redemption of the gifts by beneficiaries into different deadlines or slots or specific times.</p>
 382: <p>The benefit is limiting scope of addresses to scan to the beneficiary (and deadline). The reason you'd want to do this is say 1 million people are using this contract. Someone redeeming would need to filter through millions of utxos with the first approach but in the second only has to look at utxos associated with them. The homework switching this to 50/50 approach takes the best of both worlds. All utxos found are for the beneficiary but then you can filter on the datum for all transactions that are vested to redeem.</p>
 5689: <p>Here is a real example on Cardano mainnet and how one of the decentralized exchanges uses it. <a href="https://twitter.com/adax_pro/status/1488524779686608903" rel="nofollow noreferrer">https://twitter.com/adax_pro/status/1488524779686608903</a>
<a href="https://i.stack.imgur.com/tgiXa.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/tgiXa.png" alt="Cardano DEX" /></a></p>
