Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Wrapping the Present

Wrapping the Present

tentang Library Wrapper. mengurangi ketergantungan terhadap library lain, sehingga jika ada perubahan terhadap library pihak ketiga tidak membuat perubahan besar pada kode kita.

KMKLabs

March 28, 2018
Tweet

More Decks by KMKLabs

Other Decks in Programming

Transcript

  1. I want to put images in my app Let’s use

    Glide Ok, I put in GalleryActivity ! We need to add more feature!... that contains images. Glide works great! Let use that again. Lot of features later….. Ok glide is part of our life... Someday… Android can change it’s behaviour, or Glide can be deprecated…Anything may happen... GUYS! Android XXX is released. Glide have unsolvable bug when run in it. I think we have to move into another library, or we need to put patch on it. There are 150 place that have Glide on it….
  2. Ok, we need to change Glide to Fresco…. PM :

    ok then. I will make story for that.. Engineer : Let’s investigate it first… PM : Ok, i created story to investigate +1 Engineer : I investigated it, glide is used in 50 classes.. Let’s make chores for it, i think it will be 5 class per chore? To make the scope smaller PM : Ok, i created 10 chores to remove Glide, each contains 5 classes. +10 At the end, it will cost 11 days just to change single 3rd party library Your life will mess up when the others mess up their life.. It’s will be different story if you less depending on them..
  3. Library Class 1 Class 2 Class 3 Class 4 Library

    Wrapper I don’t even trust my own code, why i have to trust 3rd party library? Clean Code, Chapter 7 (Error Handling)
  4. What is it? And Why? • Simple Software Design Pattern

    • Act as MiddleWare • Wrapping 3rd party libraries • May be Utils or Class • Testable • Clean code • Maintainable • Less Dependent