I am considering using an abstract class with all abstract members instead of an interface in order to avoid an explicit boiler room code interface. Therefore, instead of
type IMyInterface =
abstract Name : string
abstract Text : string
type MyClass() =
member __.Name = "name"
member __.Text = "text"
interface IMyInterface with
member this.Name = this.Name
member this.Text = this.Text
I would have
[<AbstractClass>]
type MyAbstractClass() =
abstract Name : string
abstract Text : string
type MyClass() =
inherit MyAbstractClass()
override __.Name = "name"
override __.Text = "text"
Any words of caution or consequences that I should be aware of here?
source
share