Ron Kidd
asked on
Class Structure
Hello
I'm moving from a SQL and VBA background into Visual Basic .net.
I have a Question about Best Practice Class Structure.
I have an order that is saved in the database with fields
Now in .net does my Order Class include properties for BOTH the ID's and the Names for these? (As Below)
Or should the Order Class just include the ID's and get the names "On the Fly" somehow?
(I could retrieve the names from separate classes but wouldn't that involve more calls to the database?)
Thanks
I'm moving from a SQL and VBA background into Visual Basic .net.
I have a Question about Best Practice Class Structure.
I have an order that is saved in the database with fields
ID
CompanyID
OrderType
OrderStatus
The CompanyID, OrderType and OrderStatus are just ID's that link to the appropriate TablesNow in .net does my Order Class include properties for BOTH the ID's and the Names for these? (As Below)
Public Class Order
Public Property ID As Integer
Public Property CompanyID As String
Public Property CompanyName As String
Public Property TypeID As Integer
Public Property StageID As Integer
Public Property TypeNameID As String
Public Property StageName As String
End Class
Or should the Order Class just include the ID's and get the names "On the Fly" somehow?
(I could retrieve the names from separate classes but wouldn't that involve more calls to the database?)
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER