views:

149

answers:

3

I have been thinking about design patterns that are 'adaptive.' I am familiar with GoF designed to deal with known problems. What I am thinking about are the new, evolving technologies that the code I write will need to adapt to so that it can interact with evolving apis, programming languages, etc.

I am adding an example to get at what I mean beyond the basic GOF, etc. For example, we the programming community do not appear to have a software pattern for something that we do over and over again: find. That's what we do sometimes on stackoverflow. We are trying to 'find' answers to questions. So what is the symbolic language with which we universally describe a base pattern such as find?

What do you know about adaptive base design patterns?

+1  A: 

See refactoring patterns

Amit Kumar
A: 

This is vague. 'Adaptive' is overloaded. You may need an adapter because different components have different semantics, different datatypes, different histories, etc. E.g. we might be talking about making a brand spanking new F# web application talk to a crufty 1960s Cobol system.

An adapter may or may not be symmetric. For two different components Foo and Bar, Foo might consume Bar, but whether Bar consumes Foo is open-ended.

'Adaptive' could mean that we're using some sort of feedback control implemented algorithmically. Foo could adapt its behavior based on the state of Bar.

Alan
+2  A: 

Peter Norvig wrote several pieces back in the 90s you may find interesting. The general theme is to structure your programs as agents with explicit goals and a variety of ways to meet them. To adapt to the kinds of changes you're talking about, metadata about the APIs and such would need to be machine-readable, of course, to start; but perhaps that's not so unreasonable to expect these days.

Darius Bacon