Code to patterns? Or patterns from code?

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?

Posted on 9/30/2008 8:25:00 PM by Jason Nadal

Permalink | Comments |

Categories: development | patterns

Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

First Post... sorta

Well after a quite extended hiatus, here's the new blog. Trying out a new tool, as community server was more involved than I wanted to get. This one's called BlogEngine.NET & was extremely easy to set up.

Future topics will be about development in asp.net, server management, c#, scrum, design, and everything in between.

Posted on 9/30/2008 8:21:00 PM by Jason Nadal

Permalink | Comments |

Categories: personal

Tags:

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5