etienne_marais
Honorary Master
- Joined
- Mar 16, 2008
- Messages
- 15,093
I can't quite distinguish Dependency Injection (DI) from the Visitor design pattern. Is DI simply a form of the Visitor pattern, if so what qualifies it as DI ?
Be careful about a trying to summarize it too rigidly, because you can replicate the behavior of the Visitor pattern without the Visit / Accept terminology.Thanks guys.
As I have it then DI will typically assign a 'service' object/instance to a member field of the 'consumer', the consumer will then call a method on the service allowing for simplistic change of service. With visitor on the other hand, an object will Accept() a visitor object and call a method (Visit()) on this visitor allowing for extension / adding of operations of/on the object without having to modify the original object.
any good places to start reading up on patterns?
Oh gawd, I was wondering when his name would show up.
They just can't help themselves.Oh gawd, I was wondering when his name would show up.