Dietrich Bonhoeffer was an admirer of Karl Barth and his theology long before they became personal friends. Eberhard Bethge was Bonhoeffer's student, friend and biographer. In Bonhoeffer: A Biography, Bethge provides the following outline of Bonhoeffer's friendship with Karl Barth that he describes as developing through four stages: 1) awareness, 2) meetings, 3) alliance, and 4) new questions.
Stages of Friendship. The relationship between the two men went through four stages:
1. The phase of Bonhoeffer's one-sided knowledge of Barth through the latter's writings, beginning in 1925. As he eagerly and gratefully absorbed Barth's message during 1927 and 1929, Bonhoeffer directed a number of theological-epistemological questions towards Barth, under the principle of finitum capax infiniti [the finite is capable of the infinite]. Barth did not become familiar with these questions, formulated in Sanctorum Communio and Act and Being, until after Bonhoeffer's death.
2. The period of eagerly sought meetings between 1931 and 1933. Bonhoeffer hoped for Barth's support in his concern for the concrete ethical commands of the church, but did not receive this in the form he desired.
3. The phase of theological differences, accompanied by a very close alliance in church politics. Bonhoeffer attempted to think through the articles of justification and salvation independently of Barth, but he still longed secretly to claim them. Barth had reservations; only after Bonhoeffer's death did [The Cost of] Discipleship receive Barth's special praise.
4. The period of indirect new questions, in the Letters [and Papers] from Prison of 1944. These included, almost incidentally, the ominous term "positivism of revelation," which Barth could not accept and liked least of all in Bonhoeffer's work.
Whatever the implications of Bonhoeffer's criticisms of Barth, throughout these four phases Bonhoeffer viewed these criticisms as coming from within, not without, the Barthian movement. During the bitter period when Barth's former allies deserted him, Bonhoeffer had no desire to be identified with men like [Friedrich] Gogarten or [Emil] Brunner, and he vigorously attacked them. This is evident in the second and third phases of his relationship to Barth. 
[^Bonhoeffer Header Image Source] By Bundesarchiv, Bild 146-1987-074-16 / CC-BY-SA 3.0, CC BY-SA 3.0 de, https://commons.wikimedia.org/w/index.php?curid=5483382
[^Barth Header Image Source] KBA_9097_006.jpg. Digital image. Center for Barth Studies. Center for Barth Studies, n.d. Web. 16 May 2016. <http://barth2.ptsem.edu/uploadedfiles/bigsectionphotos/KBA_9097_006.jpg>.
[^1] Bethge, Eberhard. Dietrich Bonhoeffer: A Biography. New York: Harper & Row, 1970. 178. Print.
Related: Dietrich Bonhoeffer, friendship, Karl Barth