I am just learning about vb 2005 and I really like a lot of it. I have a question about the proper use of a class. I have a need to look up a doctor's patient, and other information about the patient( visits, contacts, etc.)
This is what I have so far:
Public Class Patient
Private _PatientId as String
Public Sub New(ByVal PatientId as string)
_PatientId = PatientId
' Query the Oracle database and return the patient record
end sub
Public Property PatientId() as String
Get
PatientId = _PatientId
End Get
Set
_PatientId = PatientId
' Query the Oracle database and return the patient record
End Set
End Property
Public ReadOnly Property Name() as String
Get
Name = ????
End Get
End Property
End Class
My question: Where do I put the query? How do I store the data so I don't have to do a query for every fetch of a property? (I want to update the data in the SET PatientId and the New() modules.)
Thank you for any help!
David
This is what I have so far:
Public Class Patient
Private _PatientId as String
Public Sub New(ByVal PatientId as string)
_PatientId = PatientId
' Query the Oracle database and return the patient record
end sub
Public Property PatientId() as String
Get
PatientId = _PatientId
End Get
Set
_PatientId = PatientId
' Query the Oracle database and return the patient record
End Set
End Property
Public ReadOnly Property Name() as String
Get
Name = ????
End Get
End Property
End Class
My question: Where do I put the query? How do I store the data so I don't have to do a query for every fetch of a property? (I want to update the data in the SET PatientId and the New() modules.)
Thank you for any help!
David