Swift Design Patterns (Adapter)

Поділитися
Вставка
  • Опубліковано 29 кві 2020
  • Most important design patterns and demonstration how they can be used in iOS using Swift as programming language.

КОМЕНТАРІ • 13

  • @abhaytewari6467
    @abhaytewari6467 3 роки тому +1

    That was really entertaining and simple explanation of Adapter pattern. Thank you sir !

  • @vprashant86
    @vprashant86 3 роки тому +1

    Good explanation

  • @nikhilchandrasingh2447
    @nikhilchandrasingh2447 4 роки тому +1

    Itss so nice.....,😇😇

  • @kanpurcoachingmandi9293
    @kanpurcoachingmandi9293 4 роки тому +1

    👍👍

  • @josiasmayo7203
    @josiasmayo7203 2 роки тому

    one question
    in
    ProductionDeptDataSource
    i have
    workers.append(Worker(name: "Random Name 3", department: "Production"))
    not
    workers?.append
    how come u get the optional? workers in not optional. o_o
    thanks in advance.
    great tutorial :)

    • @VenuGopalTewari
      @VenuGopalTewari  2 роки тому

      Hi Josias,
      In DataSourceBase class which is following WorkerDataSource protocol, workers get allocated as an array so inside ProductionDeptDataSource workers is non optional.

  • @chbhargavsai4068
    @chbhargavsai4068 3 роки тому +1

    Hi bro first of all thats great explanation, design patterns are complex but you are explaining those better, secondly i have a doubt in the above example when new agency conforming to search protocol the worker computed property is implemented right, then what is the need of creating workers from the DICTIONARY again, can't we use the same workers array for searching too?

    • @VenuGopalTewari
      @VenuGopalTewari  3 роки тому +1

      Hi Bhargav, Greetings from the channel !!
      This all makes my effort successful if you are finding it helpful.
      Lets come to your Query now:
      In the described sample go to ViewController.swift file, assume it as an "Utility Application" that solves searching functionality for an old agency.
      Now this agency got merged with a new agency which is maintaining their employee directory in the form of "array of dictionary".
      Our objective was without disturbing code of our "Utility Application" this should keep working for the data of new agency also but old agency search methods (Utility Application methods) work with "Worker" objects as per protocol (WorkerDataSource) so when in Adapter New Agency follows - (WorkerDataSource) protocol then we need to convert all dictionary objects into worker objects so that our app > utility app > ViewController.swift just keep on working without any structural change.
      Now assume the bigger picture here your app is only a search utility what if it contains a 1000 features in some giant application??? without Adapter how much code you are going to change ??? Just think about it.

    • @waheedafolabi6929
      @waheedafolabi6929 2 роки тому +1

      @@VenuGopalTewari This makes loads of senses...saves a whole in cost of production!

  • @ronrolle7610
    @ronrolle7610 2 роки тому

    very good video > but why music in the background and why is the unnecessary music such a terrible one ...

    • @VenuGopalTewari
      @VenuGopalTewari  2 роки тому

      This is one of the old videos, in recent videos this feedback is taken care.