I have a Java question and I can't see how I can implement the methods correctly. I am not very good with architecture.
Data Manager interface class:
public interface DataManager {
public void readData();
public void writeData();
}
Data abstract class:
public abstract class Data implements DataManager {
@Override
public void readData() {};
@Override
public void writeData() {};
}
Data Reader class:
public class DataReader extends Data {
// I want to implement the readData() here
}
Data Writer class:
public class DataWriter extends Data {
// I want to implement the writeData() here
}
If I want to implement the readData() and writeData() separately in two different classes with only one interface, is it possible? I don't know why I am doing this way. Maybe it just looks cleaner and easier when I add more methods to the reader or writer class. Should I implement everything in just one single class?
I want this library to allow users using the manager object to have access for data reading and writing. But for implementation, I don't know how I can do it correctly.