Hacker News new | ask | show | jobs
by brlewis 6581 days ago
It's called message passing. It used to be part of the commonly accepted definition of OO.
2 comments

Sure. I still think it's ugly though. It reminds me a lot of an old coworkers code. He decided to simply expose one method to his subsystem - .execute(String what, String[] args) Then you would pass in strings to specify what you wanted it to do. It made my brain hurt for weeks.
I don't see how it is more like message passing than an ordinary method call? Only difference AFAICT is that since JS don't support "catch-alls" (yet), you can't handle missing methods at the receiver. But that does not seem to be relevant here.