Skip to content

Instantly share code, notes, and snippets.

@EmilGeorgiev
Created February 11, 2016 11:38
Show Gist options
  • Select an option

  • Save EmilGeorgiev/878b5f2282f4dc006e3d to your computer and use it in GitHub Desktop.

Select an option

Save EmilGeorgiev/878b5f2282f4dc006e3d to your computer and use it in GitHub Desktop.
class Property {
private String name;
private String value;
}
interface Operator {
void changeProperties(List<Property> properties);
}
class MongoOperator implements Operator {
private final Long operatorId;
private final Datastore datastore;
public MongoOperator(Long operatorId, Datastore datastore) {
this.operatorId = operatorId;
this.datastore = datastore;
}
@Override
public void changeProperties(List<Property> properties) {
}
}
interface OperatorRepository {
Operator findOperator(Long operatorId);
}
class PersistentOperatorRepository implements OperatorRepository {
private final Datastore datastore;
public PersistentOperatorRepository(Datastore datastore) {
this.datastore = datastore;
}
@Override
public Operator findOperator(Long operatorId) {
return new MongoOperator(operatorId, datastore);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment