Possible Duplicate:
C#: Structs versus classes
I am creating a library, which is relatively small to require a database, containing tags of MP3 files.
I know that it would be better to stick with structures if I have fixed size data like integers, doubles etc... However in my case, I have strings and lists that contains strings and even other structures... If I will go with structures, it will look like this:
Public Structure STitle
Dim Title As String
Dim Path As String
End Structure
Public Structure SAlbum
Dim Album As String
Dim Songs As List(Of STitle)
End Structure
Public Structure SArtist
Dim Artist As String
Dim Albums As List(Of SAlbum)
End Structure
Then, I will have something like this:
Public SongLibrary As New List(Of SArtist)
The strings and lists are confusing me, especially speed-wise. Since I will be searching through lots of song, I want to make sure that I am using the fastest one.
I am also confused about boxing and unboxing. I assume that the list of string contains only the pointers to "the string" and same for the structures(trying to think low level). However, I don't know whether boxing-unboxing, which slows down the searching(a reason to not to use arraylists), takes place or not since the sizes are impossible to determine(or is it?)
So which one to pick? Class, or structure? or is there something else suiting better?