Callback/Command vs EventListener/Observer Pattern
I'm trying to design an async framework and wanted to know what people think are the pros/cons of the callback pattern vs the observer pattern. Callback pattern: //example callback public interface Callback{ public void notify(MethodResult result); } //example method public class Worker{ public void doAsyncWork(Callback callback){ //do work callback.notify(result); } } //example observer pattern public interface EventListener{ public void notify(MethodResult result); } public class Worker{ private EventListener listener; public registerEventListener(EventListener listener){ this.listener