Can someone explain not what MustOverride does, but why use it? Output function?
I have two classes: the first (RoomFactory);
Public MustInherit Class RoomFactory : Inherits baseFactory Private _roomid As Integer = 0 Private _roomname as String = "" Public Sub New() End Sub Public Sub New(ByVal roomid As Integer, ByVal roomname As String) Me.RoomId = roomid Me.RoomName = roomname End Sub Public MustOverride Function CreateRoom(ByVal roomdetails As RoomFactory) As Integer Public MustOverride Function IsRoomAvailable(ByVal roomdetails as RoomFactory) As Boolean // .. properties removed for brevity .. //
Second class (Room)
Public Class Room : Inherits RoomFactory Public Function CreateRoom(ByVal roomdetails As RoomFactory) As Integer Return 0 End Function Public Function IsRoomAvailable(ByVal roomdetails As RoomFactory) As Boolean Return False End Function End Class
Firstly, I think this is correct, but I would like some advice otherwise - performance, etc. But I guess the main question is: why use MustOverride?
Please excuse my ignorance here.
dooburt
source share