XPath for object graphs.

C

Chris Dunaway

Is there anything similar to XPath queries only for an object graph?
I am restricted to using VS2005 so LINQ is not an option.

Suppose I had an object graph like the following (pseudocode):

class Order {
int OrderNumber;
int CustomerNumber;
datetime OrderDate;
List<Detail> OrderDetails;
List<Address> Addresses;
}

class Detail {
string PartNo;
int Quantity;
decimal Price;
}

class Address {
string AddressType; //Possible typesShip To, Ship From, Bill
To (can be anything)
string Name;
string City;
string State;
}

So an order can have one or more details. An order can also have one
or more addresses associated with it.

I need to create a rules engine that can determine how an order can be
processed. And I need to be able to represent the rules in a string
and store them in a database. The user would be able to create a rule
based on any column in any of the objects. I am struggling on how to
handle the objects in the Lists (Detail and Address) and especially
the addresses.

For example, For customer 1234 if an order comes in where the ShipTo
address state is CA, then handle the order one way but it the state is
NY, handle it a different way. I am trying to find an efficient way
to represent these rules in a database. I was thinking of something
like XPath but for an object graph.

Can anyone make any suggestions in this regard?

Thanks,

Chris
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top