Listing B: The Table Module Pattern
Public MustInherit Class BusinessComponentBase
    Private _ds As DataSet
    Private _pk As String
    Protected Sub New(ByVal data As DataSet)
        _ds = data
        _pk = _ds.Tables(0).PrimaryKey(0).ColumnName
    End Sub
    Default Protected ReadOnly Property Item(ByVal id As Integer) As DataRow
        Get
            Dim f As String = _pk & " = " & id
            Return _ds.Tables(0).Select(f)(0)
        End Get
    End Property
    Protected ReadOnly Property Items() As DataSet
        Get
            Return _ds
        End Get
    End Property
End Class