mirror of
https://github.com/tiennm99/java-design-patterns.git
synced 2026-05-16 16:59:24 +00:00
23 lines
399 B
Java
23 lines
399 B
Java
package com.iluwatar.dependency.injection;
|
|
|
|
/**
|
|
*
|
|
* AdvancedWizard implements inversion of control.
|
|
* It depends on abstraction that can be injected through
|
|
* its constructor.
|
|
*
|
|
*/
|
|
public class AdvancedWizard implements Wizard {
|
|
|
|
private Tobacco tobacco;
|
|
|
|
public AdvancedWizard(Tobacco tobacco) {
|
|
this.tobacco = tobacco;
|
|
}
|
|
|
|
@Override
|
|
public void smoke() {
|
|
tobacco.smoke(this);
|
|
}
|
|
}
|