B
blisspikle
I figure that someone good at dotnet can look at this and give me a
clue on how to easily organize this code?
If there is a unique identifier like "Publisher" with a bunch of
"Book" that are published under them (I used the arraylist class in
the publisher class). How should the code be organized, and how can
the books properties like "Name" be easily called in the main code, or
searched for in the main code?
Public Class Publisher
Public Name As String
Private BookList As ArrayList
Public Sub New()
Name = "default"
End Sub
Public Sub AddBook(ByVal bBook As Book)
BookList.Add(bBook)
End Sub
Public ReadOnly Property Book(ByVal bBook As String) As Integer
Get
Return 1 'Haven't figured out how to search an
arraylist for the index of my book yet....
End Get
End Property
End Class
Public Class Book
Public Name As String
Public Sub New()
Name = "default" ' tag name
End Sub
Public Sub New(ByVal pName As String)
Name = pName ' book name
End Sub
End Class
clue on how to easily organize this code?
If there is a unique identifier like "Publisher" with a bunch of
"Book" that are published under them (I used the arraylist class in
the publisher class). How should the code be organized, and how can
the books properties like "Name" be easily called in the main code, or
searched for in the main code?
Public Class Publisher
Public Name As String
Private BookList As ArrayList
Public Sub New()
Name = "default"
End Sub
Public Sub AddBook(ByVal bBook As Book)
BookList.Add(bBook)
End Sub
Public ReadOnly Property Book(ByVal bBook As String) As Integer
Get
Return 1 'Haven't figured out how to search an
arraylist for the index of my book yet....
End Get
End Property
End Class
Public Class Book
Public Name As String
Public Sub New()
Name = "default" ' tag name
End Sub
Public Sub New(ByVal pName As String)
Name = pName ' book name
End Sub
End Class