88. metaclass作用?以及應用場景?

In object-oriented programming, a metaclass is a class whose instances are classes. 

Just as an ordinary class defines the behavior of certain objects, a metaclass defines the behavior of certain classes and their instances.

也就是說metaclass的實例化結果是類,而class實例化的結果是instance。

應用場景就是動態的修改類

https://www.liaoxuefeng.com/wiki/897692888725344/923030550637312

我也看不懂

https://www.iteye.com/blog/jianpx-908121

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章