N
Nemisis
hi everyone,
hope u r all ok, and looking forward to xmas, well the xmas holidays!!
lol
In my backend database i have a table that has a foreign key column in
it.
Is it best practice that when i load my object from the table, to also
load the foreign key object as part of the parent object??
Table1 (Parent)
Id
Name
Table2 foreign key
Table2 (Child, but also a parent in other areas of the system)
Id
Name
If i make an object, called Object1, i have a property called
Object1.ChildId, and another property called Object1.HasChild, which
checks the Id value and says whether it is linked or not.
Should i have a property called Object1.ChildObject, which would load
the data of the child object? I dont need to object all the time, and
thus i am wondering whether i should just load this child object into a
variable when i need it rather then everytime i load the object??
Can anyone give me there opinion? I really need it, its driving me
crasy! lol
hope u r all ok, and looking forward to xmas, well the xmas holidays!!
lol
In my backend database i have a table that has a foreign key column in
it.
Is it best practice that when i load my object from the table, to also
load the foreign key object as part of the parent object??
Table1 (Parent)
Id
Name
Table2 foreign key
Table2 (Child, but also a parent in other areas of the system)
Id
Name
If i make an object, called Object1, i have a property called
Object1.ChildId, and another property called Object1.HasChild, which
checks the Id value and says whether it is linked or not.
Should i have a property called Object1.ChildObject, which would load
the data of the child object? I dont need to object all the time, and
thus i am wondering whether i should just load this child object into a
variable when i need it rather then everytime i load the object??
Can anyone give me there opinion? I really need it, its driving me
crasy! lol