In the top of a double boiler heat chocolate, stirring occasionally until chocolate is melted and smooth. Remove from heat and allow to cool to lukewarm.
In a large bowl, beat butter and margarine until light and fluffy. Meanwhile, in a saucepan, cook sugar and water until sugar is dissolved.
In a separate medium bowl, beat egg yolks on high speed until thick and lemon coloured. Slowly pour in the hot sugar liquid while beating at medium speed until soft and well mixed. Combine the yolk mixture with the butter mixture and continue to beat for 5 minutes.
Beat in the rum and vanilla. Pour in the melted chocolate and beat until well mixed.