سؤال

I often use a framework that allow you to inherit from a certain class, and override a method there, and it will be invoked.

from the framework point of view, how is it done ? what pattern is this ?

هل كانت مفيدة؟

المحلول

Sounds like you are using a programming language / platform which provides metadata for the code. The metadata is used by the framework to find any classes which implement the certain class.

It's not a specific design pattern (not one that I know of in any way) but a technique which can be applied in most modern languages. For instance, ASP.NET uses this for it's global.asax file (and I use it in a .NET framework of mine).

It's typically used for application entry points to control the lifetime of the object.

نصائح أخرى

Not sure in what context you are using the word framework, but what you describe sounds like polymorphism.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top