“Handler” pattern?

前端 未结 6 1799
臣服心动
臣服心动 2020-12-31 07:11

I\'ve come across a design pattern that\'s been referred to as a \"Handler Pattern,\" but I can\'t find any real references to this pattern anywhere. It\'s basically just a

6条回答
  •  滥情空心
    2020-12-31 07:54

    it's the OOP way to do closures on languages that doesn't have them. it didn't have a 'pattern' name because on functional languages it's the obvious way to work. on OOP languages, OTOH, you have to do some work, so it seems a nameable idiom. 'Handler' sounds right.

    (it's not a singleton, BTW)

提交回复
热议问题