From the GoF book:
Prototype is particularly useful with static languages like C++, where classes are not objects, and little or no type information is available at run-time. It's less important in languages like Smalltalk or Objective C that provide what amounts to a prototype (i.e., a class object) for creating instances of each class. This pattern is built into prototype-based languages like Self [US87], in which all object creation happens by cloning a prototype.
What is meant by "classes are not objects"?
Isn't that always the case?
What does it mean for a class to be an object?
Aucun commentaire:
Enregistrer un commentaire