Link to home
Start Free TrialLog in
Avatar of Ron Kidd
Ron KiddFlag for Australia

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
ID
CompanyID
OrderType
OrderStatus
The CompanyID, OrderType and OrderStatus are just ID's that link to the appropriate Tables

Now 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

Open in new window


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
Avatar of Miguel Oz
Miguel Oz
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ron Kidd

ASKER

Thanks Again