UPDATE: So almost everyone here told me that I just need to start all over again as I developed my classes (thank you for the excellent answers, by the way!). Taking a hint, I began to do extensive reading in the strategy outline . I want to create behavior classes (or strategy classes) that inherit from an abstract base class or classes. The Candidate class will have properties w / various abstract base classes / classes Typefor both behavior and strategies. maybe something like this:
public abstract class SalaryStrategy {
public abstract decimal Salary { get; set; }
public abstract decimal Min { get; set; }
public abstract decimal Mid { get; set; }
public decimal CompaRatio {
get {
if (this.Mid == 0) { return 0; }
else { return this.Salary / this.Mid; }
}
}
}
public class InternalCurrentSalaryStrategy {
public override decimal Salary { get; set; }
public override decimal Min {
get { return this.Salary * .25m; }
set { }
}
public override decimal Mid { get; set; }
}
public class Candidate {
public int Id { get; set; }
public string Name { get; set; }
public SalaryStrategy CurrentSalaryStrategy { get; set; }
}
public static void Main(string[] args) {
var internal = new Candidate();
internal.CurrentSalaryStrategy = new InternalCurrentSalaryStrategy();
var internalElp = new Candidate();
internalElp.CurrentSalaryStrategy = new InternalCurrentSalaryStrategy();
var elp = new Candidate();
}
Any comments or suggestions?
ORIGINAL Question:
. , . :
public class Candidate {
public int Id { get; set; }
public string Comments { get; set; }
}
public class InternalCandidate : Candidate {
public decimal CurrentMid { get; set; }
public decimal CurrentMax {
get { return this.CurrentMin * 1.3m;
}
}
public class EntryLevelCandidate : Candidate {
public string Gpa { get; set; }
}
public class InternalEntryLevelCandidate {
}
InternalEntryLevelCandidate EntryLevelCandidate, InternalCandidate. , , , . InternalCandidate . ++ Ruby mixins, - , . , , , "": http://www.deftflux.net/blog/post/A-good-design-for-multiple-implementation-inheritance.aspx. , , . - - , , ?