I was talking with a colleague today about code patterns. How can one find a pattern based on code? Especially for things that seem to be very reused? There's the standard Gang of Four book for the obvious cases (MVC, Observer, Memento and the like), but what about those obscure cases?
We ran into a hacky solution for grouping enum values together in order to sort them by functionality. So if I have enum values of Bar1, Bar2, and Bar3, all Bar enum values and IFoo objects of types Foo1, Foo2, and Foo3, where Foo1 has a property of (Bar1 | Bar2), Foo2 has (Bar2 | Bar3) and Foo3 has (Bar1 | Bar3), how best to represent those?
Or the better question -- how to deduce a pattern from existing code? For "nonstandard" patterns?