S
sklett
I have created a series of classes for my business layer, data retrieval is
working fine and things seem good.
However I have quickly discovered a design flaw in my system in that my
objects aren't aware of siblings and parents.
In other words, if I have a Customer object and Customer objects have
CustomerSettings objects - Let's say I want to create a new Customer, then
add a set of CustomerSettings to the new customer based on CustomerSettings
from another Customer. I can't, not gracefully at least.
I need to re-design so that my objects have a common member that will expose
all the other data they need.
Since Customers are the theoretical top level node in my BOL hierarchy,
there is nothing else tying them together.
I have tried to decide how to solve this, but am coming up short. I thought
that a new, top level object called BOLDataManager that would hold Customers
and their children would be a good solution, but then I'm still faced with
the issue of the Customer objects knowing about BOLDataManager. Do I pass a
reference to it's instance everytime I add a Customer? That doesn't seem
correct.
I hope this makes sense to someone, I'm pretty stuck and I would love to
find a good solution and move on!
Thanks,
Steve
working fine and things seem good.
However I have quickly discovered a design flaw in my system in that my
objects aren't aware of siblings and parents.
In other words, if I have a Customer object and Customer objects have
CustomerSettings objects - Let's say I want to create a new Customer, then
add a set of CustomerSettings to the new customer based on CustomerSettings
from another Customer. I can't, not gracefully at least.
I need to re-design so that my objects have a common member that will expose
all the other data they need.
Since Customers are the theoretical top level node in my BOL hierarchy,
there is nothing else tying them together.
I have tried to decide how to solve this, but am coming up short. I thought
that a new, top level object called BOLDataManager that would hold Customers
and their children would be a good solution, but then I'm still faced with
the issue of the Customer objects knowing about BOLDataManager. Do I pass a
reference to it's instance everytime I add a Customer? That doesn't seem
correct.
I hope this makes sense to someone, I'm pretty stuck and I would love to
find a good solution and move on!
Thanks,
Steve