I'm just trying to think of the term for code which is written as a bridge or interface between old and new code. Essentially gluing a new API to legacy code.
Can anyone help me out?
Wrapper? I don't know whether there is a proper name for wrapping legacy code but generally a wrapper is used to make otherwise incompatible pieces of code useable by providing the correct API.
Adapter is the term I was trying to think of, though according to that Wikipedia article it's synonymous with wrapper.
Thanks — I can now write my doc block
Adapter and wrapper are essentially two of the same, but adapter is the formal term usually used in patterns books.
Also of possible interest is the strangler application, which Fowler describes as a process of gradually "strangling" legacy code and replacing with new code (As opposed to rewriting an entire system before going live):
For a more detailed breakdown of these techniques, check out the essay "Big Ball of Mud", Big Ball of Mud.
Great article Marcus!
Eric Evans calls it an anti corruption layer. See Domain Driven Design (There's a short version available for free)
Adapter sound a lot more succinct than Anti Corruption Layer; maybe the latter does more.