public DestributedRepository createRepository() { DestributedRepository dr = new DestributedRepository(); if (repositories.Count != 0) { dr.synchronizeWith(repositories[0]); } foreach (DestributedRepository repo in repositories) { repo.addObserver(dr); dr.addObserver(repo); } repositories.Add(dr); return dr; }
public DestributedRepository createRepository() { DestributedRepository dr = new DestributedRepository(); if (repositories.Count != 0) { dr.synchronizeWith(repositories[0]); } foreach (DestributedRepository repo in repositories) { repo.addObserver(dr); dr.addObserver(repo); } repositories.Add(dr); return(dr); }
public void synchronizeWith(DestributedRepository repository) { this.data = repository.getData(); }