What is Opf3? Why is Opf3? How is Opf3? All these burning questions and issues discussed here.
They have a large number of differing fields and as such are right now represented in two seperate tables. The only fields they do have in common (inherited from Customer) would be ID and Active.In the Database I currently have two tables: People, Companies. I also have a table Called Orders which contains a CustomerId and CustomerType column (this is from the way I used to do things so this may be all wrong).What I would like to do is be able to navigate from an Order Persistant to the Customer. Sounds easy right? It would be if they were in the same table (which would have something along the lines of a 20+ columns to handle the two different types of Customers). I know that if they were in the same table I could use a PersistantTypeSelector delegate to retrieve the correctly typed Object. However I would like to find some way to accomplish the same thing (more or less) without having to create a Customers table with 20+ columns.What I have done now is to use the value of the CustomerType field to determine the Type of Persistant to set as T for a ObjectContext's GetObject(of T)("Id = {0}", Me.CustomerId) in a custom property called Customer of the Order object.
question: What I would like to know is there a better way to do this? One with less custom code and logic? Other than creating a massive table with dozens of columns? Am I totally missing a concept here (wouldn't be the first time)? I'm looking for the most elegant solution with the easiest maintainable code. I can redesign the database as needed so that isn't a problem.