Delphi Language Guide Delphi for Microsoft Win32 Delphi for the Microsoft. Net framework



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə164/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   160   161   162   163   164   165   166   167   ...   294
DelphiLanguageGuide

Virtual Versus Dynamic
Virtual and dynamic methods are semantically equivalent. They differ only in the implementation of method-call
dispatching at runtime. Virtual methods optimize for speed, while dynamic methods optimize for code size.
In general, virtual methods are the most efficient way to implement polymorphic behavior. Dynamic methods are
useful when a base class declares many overridable methods which are inherited by many descendant classes in
an application, but only occasionally overridden.
Note:
Only use dynamic methods if there is a clear, observable benefit. Generally, use virtual methods.

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   160   161   162   163   164   165   166   167   ...   294




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin