Vote UpVote

Using configuration records and operators to reduce number of overloaded methods

The Delphi Geek – When writing libraries you sometimes want to provide users (that is, programmers) with a flexible API. If a specific part of your library can be used in different ways, you may want to provide multiple overloaded methods accepting different combinations of parameters.For example, IOmniPipeline interface from OmniThreadLibrary implements three overloaded Stage functions.function  Stage(pipelineStage: TPipelineSimpleStageDelegate; taskConfig: IOmniTaskConfig = nil): IOmniPipeline; overload;function  Stage(pipelineStage: TPipelineStageDelegate; taskConfig: IOmniTaskConfig = nil): ...
Favorite? Off-Topic? Primož Gabrijelčič @ 2018-11-08 22:03


Visits: 289
Votes: 0
Favorites: 0
Off-Topic: 0

Visits by Source

User Actions

Users who voted for this posting

Contact us to advertise on DelphiFeeds.com

Community Links

Torry Firebird News


Please login or register to use this functionality.
(click on this box to dismiss)