Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

좋은 코드를 고민하는 주니어 개발자들을 위한 안드로이드 디자인 패턴

5,694 views

Published on

DevFest2017에서 발표했던 발표 자료 업로드합니다.

Published in: Technology

좋은 코드를 고민하는 주니어 개발자들을 위한 안드로이드 디자인 패턴

  1. 1. Extended Seoul
  2. 2. Extended Seoul
  3. 3. Extended Seoul
  4. 4. Extended Seoul
  5. 5. Extended Seoul
  6. 6. Extended Seoul
  7. 7. Extended Seoul
  8. 8. Extended Seoul
  9. 9. Extended Seoul
  10. 10. Extended Seoul
  11. 11. Extended Seoul
  12. 12. Extended Seoul
  13. 13. Extended Seoul
  14. 14. Extended Seoul
  15. 15. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Mypage 12D3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0
  16. 16. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Mypage 12D3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0
  17. 17. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Mypage 12D3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0
  18. 18. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Mypage 12D3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0
  19. 19. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Mypage 12D3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0
  20. 20. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Mypage 12D3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0
  21. 21. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Mypage 12D3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0
  22. 22. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Mypage 12D3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0
  23. 23. @Override protected void onResume() { super.onResume(); NetworkManager.getUser(user.id).subscribe((User) user -> { changeUserView(user); }); }
  24. 24. @Override protected void onResume() { super.onResume(); NetworkManager.getUser(user.id).subscribe((User) user -> { changeUserView(user); }); }
  25. 25. @Override protected void onResume() { super.onResume(); NetworkManager.getUser(user.id).subscribe((User) user -> { changeUserView(user); }); }
  26. 26. @Override protected void onResume() { super.onResume(); NetworkManager.getUser(user.id).subscribe((User) user -> { changeUserView(user); }); }
  27. 27. @Override protected void onResume() { super.onResume(); NetworkManager.getUser(user.id).subscribe((User) user -> { changeUserView(user); }); }
  28. 28. @Override protected void onResume() { super.onResume(); NetworkManager.getUser(user.id).subscribe((User) user -> { changeUserView(user); }); }
  29. 29. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  30. 30. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  31. 31. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  32. 32. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  33. 33. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  34. 34. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  35. 35. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  36. 36. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  37. 37. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  38. 38. public class ChangeUserEvent { private User user; public ChangeUserEvent(User user) { this.user = user; } }
  39. 39. public class ChangeUserEvent { private User user; public ChangeUserEvent(User user) { this.user = user; } }
  40. 40. public class MypageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mypage); ... } ... @Subscribe public void onChangeUserEvent(ChnageUserEvent event) { changeUserView(event.user); }; }
  41. 41. public class MypageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mypage); ... } ... @Subscribe public void onChangeUserEvent(ChangeUserEvent event) { changeUserView(event.user); }; }
  42. 42. public class MypageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mypage); ... } ... @Subscribe public void onChangeUserEvent(ChangeUserEvent event) { changeUserView(event.user); }; }
  43. 43. public class MypageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mypage); ... } ... @Subscribe public void onChangeUserEvent(ChangeUserEvent event) { changeUserView(event.user); }; }
  44. 44. public class ProfileActivity extends AppCompatActivity { ... private void setUser(User user) { EventBus.getDefault().post(new ChangeUserEvent(user)); } }
  45. 45. public class ProfileActivity extends AppCompatActivity { ... private void setUser(User user) { EventBus.getDefault().post(new ChangeUserEvent(user)); } }
  46. 46. public class ProfileActivity extends AppCompatActivity { ... private void setUser(User user) { EventBus.getDefault().post(new ChangeUserEvent(user)); } }
  47. 47. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  48. 48. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  49. 49. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  50. 50. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  51. 51. Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12;3 0 Page Title 12<3 0 Angie Pine Rotterdam On the Radio Activity Videography Discography Tickets News 1 12<3 0 She is a sort of life changing person. 8,5K1 min agoAngie Pine Angie Pine Rotterdam 127 Followers • 387 Likes Profile 12D3 0
  52. 52. public class MypageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mypage); RxBus.getInstance() .getObservable() .subscribe( user -> changeUserView(user) ); }
  53. 53. public class MypageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mypage); RxBus.getInstance() .getObservable() .subscribe( user -> changeUserView(user) ); }
  54. 54. public class MypageActivity extends AppCompatActivity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_mypage); RxBus.getInstance() .getObservable() .subscribe( user -> changeUserView(user) ); }
  55. 55. public class ProfileActivity extends AppCompatActivity { ... private void setUser(User user) { RxBus.getInstance().sendEvent(user); } }
  56. 56. public class ProfileActivity extends AppCompatActivity { ... private void setUser(User user) { RxBus.getInstance().sendEvent(user); } }
  57. 57. public class Developer { private String name; private int age; private String language; private String company; private String school; private boolean is_android_developer; private View.OnClickListener reaction; public Developer(String name, int age, String language, String company, String school, boolean is_android_developer, View.OnClickListener reaction) { this.name = name; this.age = age; this.language = language; this.company = company; this.school = school; this.is_android_developer = is_android_developer; this.reaction = reaction; } }
  58. 58. public class Developer { private String name; private int age; private String language; private String company; private String school; private boolean is_android_developer; private View.OnClickListener reaction; public Developer(String name, int age, String language, String company, String school, boolean is_android_developer, View.OnClickListener reaction) { this.name = name; this.age = age; this.language = language; this.company = company; this.school = school; this.is_android_developer = is_android_developer; this.reaction = reaction; } }
  59. 59. public class Developer { private String name; private int age; private String language; private String company; private String school; private boolean is_android_developer; private View.OnClickListener reaction; public Developer(String name, int age, String language, String company, String school, boolean is_android_developer, View.OnClickListener reaction) { this.name = name; this.age = age; this.language = language; this.company = company; this.school = school; this.is_android_developer = is_android_developer; this.reaction = reaction; } }
  60. 60. public class Developer { private String name; private int age; private String language; private String company; private String school; private boolean is_android_developer; private View.OnClickListener reaction; public Developer(String name, int age, String language, String company, String school, boolean is_android_developer, View.OnClickListener reaction) { this.name = name; this.age = age; this.language = language; this.company = company; this.school = school; this.is_android_developer = is_android_developer; this.reaction = reaction; } }
  61. 61. public class Developer { private String name; private int age; private String language; private String company; private String school; private boolean is_android_developer; private View.OnClickListener reaction; public Developer(String name, int age, String language, String company, String school, boolean is_android_developer, View.OnClickListener reaction) { this.name = name; this.age = age; this.language = language; this.company = company; this.school = school; this.is_android_developer = is_android_developer; this.reaction = reaction; } }
  62. 62. public class Developer { private String name; private int age; private String language; private String company; private String school; private boolean is_android_developer; private View.OnClickListener reaction; public Developer(String name, int age, String language, String company, String school, boolean is_android_developer, View.OnClickListener reaction) { this.name = name; this.age = age; this.language = language; this.company = company; this.school = school; this.is_android_developer = is_android_developer; this.reaction = reaction; } }
  63. 63. AlertDialog alertDialog = new AlertDialog.Builder(this) .setTitle("DevFest2017") .setMessage("좋은 코드를 고민하는 주니어 개발자들을 위한 안드로이드 디자인 패턴") .setNegativeButton("취소", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // 취소 클릭 시 } }) .setPositiveButton("입장", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // 입장 클릭 시 } }) .show();
  64. 64. AlertDialog alertDialog = new AlertDialog.Builder(this) .setTitle("DevFest2017") .setMessage("좋은 코드를 고민하는 주니어 개발자들을 위한 안드로이드 디자인 패턴") .setNegativeButton("취소", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // 취소 클릭 시 } }) .setPositiveButton("입장", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // 입장 클릭 시 } }) .show();
  65. 65. AlertDialog alertDialog = new AlertDialog.Builder(this) .setTitle("DevFest2017") .setMessage("좋은 코드를 고민하는 주니어 개발자들을 위한 안드로이드 디자인 패턴") .setNegativeButton("취소", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // 취소 클릭 시 } }) .setPositiveButton("입장", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // 입장 클릭 시 } }) .show();
  66. 66. AlertDialog alertDialog = new AlertDialog.Builder(this) .setTitle("DevFest2017") .setMessage("좋은 코드를 고민하는 주니어 개발자들을 위한 안드로이드 디자인 패턴") .setNegativeButton("취소", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // 취소 클릭 시 } }) .setPositiveButton("입장", new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialogInterface, int i) { // 입장 클릭 시 } }) .show();
  67. 67. Developer developer = new Developer.Builder(this) .setName("워니") .setAge(24) .setLanguage("JAVA") .setCompany(“트레바리") .setSchool("가천대") .set_android_developer(true) .setReaction(new View.OnClickListener() { @Override public void onClick(View view) { smile(); } }) .build();
  68. 68. 이미지 출처: http://www.karthikscorner.com/sharepoint/design-patterns-adapter-pattern
  69. 69. 이미지 출처: http://www.karthikscorner.com/sharepoint/design-patterns-adapter-pattern
  70. 70. 이미지 출처: http://www.karthikscorner.com/sharepoint/design-patterns-adapter-pattern
  71. 71. 이미지 출처: http://www.karthikscorner.com/sharepoint/design-patterns-adapter-pattern
  72. 72. Person#1 Person#2 Person#3 Person#n … Adapter
  73. 73. Person#1 Person#2 Person#3 Person#n … Adapter
  74. 74. Person#1 Person#2 Person#3 Person#n … Adapter
  75. 75. Person#1 Person#2 Person#3 Person#n … Adapter

×