what's difference between a callback and observer pattern in java -


i going through following link in stack on flow

how perform java callback between classes?

in particular question answer 18 refers callbacks , answer 9 refers observer pattern.

i unable distinguish difference between both.

can please explain these 2 approaches differ?

a callback piece of code provide class , gets called @ point. ex:

serverconnectionhandler = new serverconnections(new itypedcallback<socket>() {         @override         public void execute(socket socket) {             // socket here         } }); 

the observer's pattern design pattern based on callbacks. can find more details here http://en.wikipedia.org/wiki/observer_pattern.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -