Question

Houston, we have a problem. I can't think of a simple class name. I have abstract class, something like that:

public abstract class DataDisplay {
    public abstract void dataDisplay(Data data);
}

This class only displays data in some way: paint it to canvas, send SMS, send bytes through socket, etc.

Was it helpful?

Solution

  1. It seems like it should be an interface, not an abstract class.
  2. It is too generic if it can do anything from printing to console to sending your data to space. You may end up violating single responsibility principle in your implementations.

If still you think it's OK, I'd say it is a Representer since it deals with some Data type and presents it in a different ways, i.e. represents what is present as Data. I have no deep enough knowledge of English, but it seems reasonable.

Licensed under: CC-BY-SA with attribution
scroll top