1

I have written/am writing a large number of predicates for testing the state of a single complex entity. These predicates are partially LINQ queries (that I assume are turned into SQL) and partially C# lambda/methods used to verify the state of the entity.

This all seems to remind me of digital design and K-maps. But maybe that is a wrong turn

I doubt I am the first person to have this problem. Can anyone tell me what design patterns or best practices are available in this area?

RBZ
  • 2,034
  • 17
  • 34
  • I don't think there's enough context here to give you a good answer, but if you can recognize similarities between your app and k-maps, then you're probably already at the level where your library is designed with the best patterns and practices. – Juliet May 06 '11 at 01:34

1 Answers1

0

The main question is "how are you going to use these predicates?" These predicates should be organized for fast retrieval of relevant predicates for the tasks in your particular domain. Since domains differ, the appropriate indexing strategy may differ as well.

For example, if groups of predicates are related to concepts and need to be retrieved by concept, you could use a conceptual graph and spreading activation strategy to retrieve relevant predicates.

Or simple hash tables and trees might be all that you need, indexing by predicates (aka relations) within the query and the attributes within the predicate (relation).

Larry Watanabe
  • 10,126
  • 9
  • 43
  • 46