Should Class Helpers be used in developing new code?

前端 未结 10 1654
眼角桃花
眼角桃花 2021-02-14 10:51

Delphi 8 introduced Class Helpers for the purposes of mapping the VCL/RTL to the .NET object hierarchy. They allow injecting methods into an existing class without overriding t

10条回答
  •  渐次进展
    2021-02-14 11:31

    Depends what you mean by "new code".

    They aren't really relevant for classes you are newly developing, so in that case, no, they probably shouldn't be used.

    But even in a brand new project, you may still need to modify an existing class that you can't change in other ways (vcl class, third-party class, etc). In this case, sure, I'd say go ahead.

    They're not evil in and of themselves. Like most other things, you just need to understand how they work and use them in an appropriate context.

提交回复
热议问题