Adapter is a structural design pattern that allows objects with incompatible interfaces to work together.
Use case
When you need to make new code work with existing code that has a different interface.
It's way to make new class compatible with existing class without changing the existing class or new class.
For example for license management when you want to switch to xml to json format for license management. You can use adapter pattern to convert xml to json and vice versa. so app stay compatible with both formats.
//Client codevarmodelData=newModelData{Name="Box Model",GridX=3,GridY=2};IModelProvidermodelProvider=newStaadModelProvider(modelData);modelProvider.OpenModel();//Open staad model data in Midas model provider using adaptermodelProvider=newStaadToMidasAdapter((StaadModelProvider)modelProvider);modelProvider.OpenModel();