refactoring : refused bequest

This commit is contained in:
haerong22
2022-04-13 15:00:57 +09:00
parent 1334689b2f
commit 0a0c21e12f
8 changed files with 51 additions and 0 deletions

View File

@@ -0,0 +1,5 @@
package com.example.refactoring._23_refused_bequest;
public class Employee {
}

View File

@@ -0,0 +1,5 @@
package com.example.refactoring._23_refused_bequest;
public class Engineer extends Employee {
}

View File

@@ -0,0 +1,4 @@
package com.example.refactoring._23_refused_bequest;
public class Quota {
}

View File

@@ -0,0 +1,11 @@
package com.example.refactoring._23_refused_bequest;
public class Salesman extends Employee {
protected Quota quota;
protected Quota getQuota() {
return new Quota();
}
}

View File

@@ -0,0 +1,11 @@
package com.example.refactoring._23_refused_bequest._before;
public class Employee {
protected Quota quota;
protected Quota getQuota() {
return new Quota();
}
}

View File

@@ -0,0 +1,5 @@
package com.example.refactoring._23_refused_bequest._before;
public class Engineer extends Employee {
}

View File

@@ -0,0 +1,4 @@
package com.example.refactoring._23_refused_bequest._before;
public class Quota {
}

View File

@@ -0,0 +1,6 @@
package com.example.refactoring._23_refused_bequest._before;
public class Salesman extends Employee {
}