I have trouble understanding these two design patterns.
Can you please give me contextual information or an example so I can get a clear idea and be able to map the dif
The visitor is like a one-night stand - you create it when you call the accept function and then they get separated and the visitor can be cleaned from the memory, it doesn't take any room for the class that use it.
The strategy is like a marriage - you create the object, it lives in the class that uses it, takes memory, has a room and makes itself a coffee in the morning :) . Of course they can get a divorce and switch to another class but that class would also live in its owner's context.
Hope it helps you remember :)