What's the term for code allowing legacy & new to interact?

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 pattern?

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 :slight_smile:

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):

StranglerApplication

Cheers,
Alex

Hi…

For a more detailed breakdown of these techniques, check out the essay “Big Ball of Mud”, Big Ball of Mud.

yours, Marcus

In Windows, those are called shims. https://secure.wikimedia.org/wikipedia/en/wiki/Shim_(computing)

Great article Marcus! :slight_smile:
Steve

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.