[fpc-devel] simpleipc issues

Ondrej Pokorny lazarus at kluug.net
Wed Nov 11 18:09:22 CET 2015


On 11.11.2015 17:47, Michael Van Canneyt wrote:
> I checked the patch and applied it, so people can try it.
>
> I have several remarks:
>
> a) Your TBaseSingleInstance class contains too many methods.
>    It assumes you are using advancedipc.
>    I suggest refactoring such a way that advancedipc is in the 
> implementation section of the class.
>
>    or introduce TAbstractSingleInstance as a parent of 
> TBaseSingleInstance with the bare minimum of methods/properties.
>
> b) There is no way to have TCustomApplication create a different 
> singleinstance class, for 2 reasons:
>   1. Your property is declared as TCustomSingleInstance.
>      It should be TBaseSingleInstance (or TAbstractSingleInstance)
>      That means that the 'enabled' property should be in 
> TBaseSingleInstance or TAbstractSingleInstance.
>   2. You create the instance as TCustomSingleInstance.Create in the 
> constructor.
>      It should be a function CreateSingleinstance : 
> TCustomSingleInstance;
>
> Can you have a look at these remarks ? If something is not clear, let 
> me know.

Great!

Your remarks are reasonable. I'll rewrite the code so that it supports 
modifications!

Ondrej



More information about the fpc-devel mailing list