mirror of
https://github.com/emilybache/GildedRose-Refactoring-Kata.git
synced 2026-02-19 16:31:30 +00:00
Remove DefaultItemBehavior impl
We will not create a class for every flavor of behavior possible. We will compose the behaviors by injecting quality and sellIn behavior in the constructor
This commit is contained in:
parent
f98d6bcaf6
commit
05a3cf148a
@ -1,19 +0,0 @@
|
|||||||
package com.gildedrose.behavior.item;
|
|
||||||
|
|
||||||
import com.gildedrose.Item;
|
|
||||||
import com.gildedrose.behavior.quality.DefaultQualityBehavior;
|
|
||||||
import com.gildedrose.behavior.sellin.DefaultSellInBehavior;
|
|
||||||
import com.gildedrose.behavior.quality.QualityBehavior;
|
|
||||||
import com.gildedrose.behavior.sellin.SellInBehavior;
|
|
||||||
|
|
||||||
public class DefaultItemBehavior implements ItemBehavior {
|
|
||||||
|
|
||||||
private final QualityBehavior qualityBehavior = new DefaultQualityBehavior();
|
|
||||||
private final SellInBehavior sellInBehavior = new DefaultSellInBehavior();
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void processUpdate(Item item) {
|
|
||||||
qualityBehavior.processQualityUpdate(item);
|
|
||||||
sellInBehavior.processSellInUpdate(item);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
Reference in New Issue
Block a user