L
lithoman
I have been working with objects long enough to have the basics down,
but some things give me fits, and this is one of them.
Brief description:
I have an airplane object, and each airplane has an owner.
Likewise I have a customer object and each customer has a list of
airplanes.
The basic structure of my objects is: (ignoring public/private for
clarity)
public class Aircraft
{
int ID;
string Series;
List<Aircraft_Options> OptionList;
Customer Owner;
/* Assorted Methods */...
}
public class Customer
{
int ID;
string Name;
List<Aircraft> AircraftList;
/* Assorted Methods */...
}
I want Aircraft to have the Customer object for reference when I grab
the Aircraft List, and obviously when I grab the Customer I want access
to all the associated aircraft. It seems to me I'll run into problems
with recursion. I considered a limited Customer class for Aircraft to
have, but that doesn't strike me as efficient.
How should I best deal with this situation?
but some things give me fits, and this is one of them.
Brief description:
I have an airplane object, and each airplane has an owner.
Likewise I have a customer object and each customer has a list of
airplanes.
The basic structure of my objects is: (ignoring public/private for
clarity)
public class Aircraft
{
int ID;
string Series;
List<Aircraft_Options> OptionList;
Customer Owner;
/* Assorted Methods */...
}
public class Customer
{
int ID;
string Name;
List<Aircraft> AircraftList;
/* Assorted Methods */...
}
I want Aircraft to have the Customer object for reference when I grab
the Aircraft List, and obviously when I grab the Customer I want access
to all the associated aircraft. It seems to me I'll run into problems
with recursion. I considered a limited Customer class for Aircraft to
have, but that doesn't strike me as efficient.
How should I best deal with this situation?