OOP: When is it an object?

前端 未结 20 1350
悲哀的现实
悲哀的现实 2021-01-30 23:01

I\'m trying to understand object orientation. I understand it a little bit of course, but sometimes I\'m not 100% clear. How do you decide what should be turned into an object (

20条回答
  •  醉话见心
    2021-01-30 23:46

    Good old Plato already had an answer (kind of)...

    But your question depends a lot on the language you're using, so there's no universal truth here. In some languages a thing should be a class, but it might be an object in others, or both (in those that have meta object protocols), or just a record of values and related functions.

提交回复
热议问题