Grokking the Object Oriented Design Interview
Ask Author
Back to course home

0% completed

Vote For New Content
I still dont quite understand what's the difference between "include" and "exten...

FANG2022

Oct 9, 2022

I still dont quite understand what's the difference between "include" and "extend". Like I can argue that "make payment" just some additional step of checkout shopping cart. Can you explain the differences or give me a better example? Thanks

1

0

Comments
Comments
D
dayvsnight0007 2 years ago

Hi there!

Making payment and checkout shopping cart or not as same as searching a product and searching a product by category.

Its very clear that searching product and searching product by category both involves a searching algorithms with minor twigs, so it can be ...

 StellaZarei
StellaZarei5 months ago

This is how I understand it:

If action A is contained within action B, then it's an "includes relationship".

For example: drive to the store --<<includes>>-> start car.

However, if action A can be completed in multiple ways (actions B or C), then ea...