N
Nemisis
Hi all,
I have 2 classes, for example. I have a Company class and a contact
class.
each class has the following properties
Company
ID
Name
Town
Ref
Contact
CompanyID
FirstName
LastName
Email
Now if i am retrieving the data from my database and filling the
contact class, is it ok to populate the contacts companyname, for
example
Contact.FirstName = "XXX"
Contact.lastname = "XXX"
Contact.Company.ID = 99
Contact.Company.Name = "XXXX"
Is this best practice, or should i be doing this another way? I
thought this would make sense to do, as most of the time if i have a
contact class, i usually want to show the companyName.
Anyone know of a better way to do this, or the "best practice way"??
Cheers
I have 2 classes, for example. I have a Company class and a contact
class.
each class has the following properties
Company
ID
Name
Town
Ref
Contact
CompanyID
FirstName
LastName
Now if i am retrieving the data from my database and filling the
contact class, is it ok to populate the contacts companyname, for
example
Contact.FirstName = "XXX"
Contact.lastname = "XXX"
Contact.Company.ID = 99
Contact.Company.Name = "XXXX"
Is this best practice, or should i be doing this another way? I
thought this would make sense to do, as most of the time if i have a
contact class, i usually want to show the companyName.
Anyone know of a better way to do this, or the "best practice way"??
Cheers