NOTE: Sorry for the long question!
I\'m trying to understand some key areas behind object orientation and I couldn\'t decide one way or another about my par
Do this:
public interface Writable {
public void Save(Writer w);
}
public interface Writer {
public void WriteTag(String tag, String cdata);
}
public class Bob : Writable {
private String ssn = "123-23-1234";
public void Save(Writer w) {
w.WriteTag("ssn", ssn);
}
}
public class XmlWriter : Writer {
public XmlWriter(Sting filename) {...}
public void WriteTag(String tag, Sting cdata) {...}
}
Obviously this isn't a complete solution but you should get the general idea.