I know this question can be considered as "too broad", but if some of experts can give me the idea or guidance about this question then it will be very helpful to decide which design paradigms I should use ?
I have created number of projects in OOP, as I watch and come through POP, I got understandings that we can achieve what class can do by replacing it with combination of Struct and Protocol.
And as I go through WWDC event video, they quoted "Do not start with class, start with protocol", I also go through examples and tutorials
But yet it is not very much clear when to use Struct or class. As some of the times we need to use Class.
To more elaborate the question,
Consider an example app : In which I have to call web service, Get Data, convert them into Models, Bind them in UI. The basic simple app which we developed in iOS. So for this What approach should I use ?
To clear my understandings I also go through open source swift apps source codes but in that most of the times they have used the Classes.
So In which cases we should use **Classes instead of Struct and Protocol. ?**
As I get know POP is very helpful to reduce duplicate codes and make code Bug free when we are dealing with Multi-threading.
It will be very helpful if someone can help me out to understand this more clearly.
Aucun commentaire:
Enregistrer un commentaire