That was really entertaining and simple explanation of Adapter pattern. Thank you sir !
@VenuGopalTewari3 жыл бұрын
This made my efforts success !
@josiasmayo72032 жыл бұрын
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 :)
@VenuGopalTewari2 жыл бұрын
Hi Josias, In DataSourceBase class which is following WorkerDataSource protocol, workers get allocated as an array so inside ProductionDeptDataSource workers is non optional.
@vprashant864 жыл бұрын
Good explanation
@VenuGopalTewari3 жыл бұрын
This made my effort success !
@ronrolle76102 жыл бұрын
very good video > but why music in the background and why is the unnecessary music such a terrible one ...
@VenuGopalTewari2 жыл бұрын
This is one of the old videos, in recent videos this feedback is taken care.
@nikhilchandrasingh24474 жыл бұрын
Itss so nice.....,😇😇
@kanpurcoachingmandi92934 жыл бұрын
👍👍
@chbhargavsai40683 жыл бұрын
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?
@VenuGopalTewari3 жыл бұрын
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.
@waheedafolabi69292 жыл бұрын
@@VenuGopalTewari This makes loads of senses...saves a whole in cost of production!