SoftInterface

The SoftInterface aspect can be applied to an interface to make it a Soft Interface to work with Duck Typing. Soft interfaces are a special kind of interface that is compatible with any class that implements its members – regardless of whether the class explicitly declares conformance to the interface or not.

On Oxygene, the soft keyword is used for similar effect, so this aspect is provided mostly for C#, Swift, Java and Mercury use (although it is available to Oxygene as well).

type
  INumberToStringFormatter = soft interface
    method ToString(aFormat: String): String;
  end;
[SoftInterface]
public interface INumberToStringFormatter
{
    void string ToString(string format);
}
@SoftInterface
public interface INumberToStringFormatter {
    func ToString(_ format: String) -> String
}
@SoftInterface
public interface INumberToStringFormatter
{
    void string ToString(string format);
}
<SoftInterface>
Public Interface INumberToStringFormatter
  Function ToString(format As String) As String
End Interface

Defined in RemObjects.Elements.Cirrus.dll

See Also