public interface QueryAdapter { QueryAdapter select(String... fields); QueryAdapter from(String tableName); Graph aggregate(Aggregation aggregation); } public interface Aggregation<T extends Number> { T calculate(); } public class Graph { // This is a DTO, a graph representation of tabular data }