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

God’s Architecture. How-to.

God’s Architecture. How-to.

KyivAndroidDevClub #12. November 11 2017

Avatar for Alexandr Voronsky

Alexandr Voronsky

November 11, 2017

Other Decks in Programming

Transcript

  1. class SuperActivity : NotSuperActivity(), SuperView { fun createAwesomeUi() { ...

    } fun doFastRestCall() { ... } fun changeAllSingletonsState() { ... } fun justMakeYouFeelPainWithTests() { ... } override fun universalProblemSolver() { ... } }
  2. class SocketReader { fun read(bytes: ByteArray) { ... } private

    fun getMessageType(): MessageType { ... } private fun write(bytes: ByteArray) { ... } }
  3. open class SocketReader { init { createBaseReader() } open fun

    createBaseReader() { ... } fun makeSocketFast() { ... } }
  4. open class Bird { open fun setLocation(x: Int, y: Int)

    { ... } open fun setAltitude(z: Int) { ... } } class Penguin : Bird() { // Sorry, mister, but I can't fly // Check your inheritance, setAltitude() is USELESS }
  5. class Plane : Transport { override fun fly() { /*

    Flying */ } override fun ride() { /* Riding */ } } class Cab : Transport { override fun fly() { /* Can't fly */ } override fun ride() { /* Riding */ } }
  6. interface Transport class Plane : Transport class Cab : Transport

    fun addTransport(machines: List<Plane>) { ... } fun addTransport(machines: List<Cab>) { ... } fun addTransport(machines: List<Transport>) { ... }
  7. MVP: - Presenters are so fat - Sometimes business logic

    migrates to Presenters MVC: - Relationship between View and Model - Not enough to use in real Android life MVVM: - Brings VM overhead for complex solutions - Android DataBinding is a bad way
  8. - Independent and robust modules - High percent of test

    coverage - Great abstractions - Easy for maintaining and extending - Code is really clear as it possible - Uncle Bob is happy +
  9. – - A lot of time to implement - A

    lot of code files - Communication is ugly - Not reusable modules