Participants

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/a83e79d5-d5fc-4142-804f-cda87b1b6680/Untitled.png

private static void Main()
{
	IAcceptedContract adapter = new ComplexSystemAdapter();
	foreach (string item in adapter.GetList())
		Console.Write(item);
}

public class ComplexSystem
{
	public string[][] GetComplexItems()
	{
		string[][] employees = new string[4][];

		employees[0] = new string[] { "100", "Deepak", "Team Leader" };
		employees[1] = new string[] { "101", "Rohit", "Developer" };
		employees[2] = new string[] { "102", "Gautam", "Developer" };
		employees[3] = new string[] { "103", "Dev", "Tester" };

		return employees;
	}
}

public interface IAcceptedContract
{
	List<string> GetList();
}    

public class ComplexSystemAdapter : ComplexSystem, IAcceptedContract
{
	public List<string> GetList()
	{
		var employeeList = new List<string>();
		var employees = GetComplexItems();
		foreach (string[] employee in employees)
		{
			employeeList.Add(employee[0]);
			employeeList.Add(employee[1]);
			employeeList.Add(employee[2]);
		}
		return employeeList;
	}
}
private static void Main()
{
	var complexSystem = new ComplexSystem();
	IAcceptedContract employeeAdapter = new ComplexSystemAdapter(complexSystem);
	// ...
}

public class ComplexSystemAdapter : IAcceptedContract
{
	private ComplexSystem _ComplexSystem;
	public ComplexSystemAdapter(ComplexSystem complexSystem)
	{
		_ComplexSystem = complexSystem;
	}

	public List<string> GetList()
	{
		// ...
		var employees = _ComplexSystem.GetComplexItems();
		// ...
	}
}

https://s3-us-west-2.amazonaws.com/secure.notion-static.com/dd4f5f72-05d2-48f6-9141-ddad1dbbc1e9/Untitled.png

Rules of Thumb