Protocol-Oriented Programming in Swift 5
Familiarize yourself with POP to fully unleash the power of Swift 5 and protocols
-
-
4,0 • 1 Bewertung
-
-
- 11,99 €
-
- 11,99 €
Beschreibung des Verlags
Protocol-Oriented Programming is a powerful approach that makes it easier to write efficient, elegant, and professional Swift code. Anyone who plans to design, implement, or understand a modern Swift codebase needs to understand this programming paradigm.
I’ll make the transition from Object-Oriented Programming to Protocol-Oriented Programming as smooth as possible—regardless of whether you’ve been working with object-oriented languages for decades or you’re just about to write your first, extensive project in Swift.
We’ll begin with an in-depth discussion of what Protocol-Oriented Programming is and what makes it different from the object-oriented programming approach.
We’ll then talk about three fundamental concepts:
• Protocol extensions
• Protocol inheritance
• Protocol composition
Understanding these concepts is crucial to applying the Protocol-Oriented Programming (POP) paradigm effectively.
To solidify them, I’m going to lead you through several Swift coding examples.
Although this book focuses on POP, we’ll usually encounter generics when using protocols. I dedicated an entire chapter to show you how to leverage the power of generics combined with protocols.
Finally, you can follow along with me as I build a full-blown application from scratch using the protocol-oriented approach.
Throughout the book, you'll acquire coding skills that can be applied in real-world situations. And by the time you finish, you’ll have the knowledge to design and write professional applications that leverage the power of protocol-oriented programming.
Kundenrezensionen
Hat mir sehr gut gefallen, aber…
Das Buch ist eine gut lesbare Darstellung des „Warum“ und „Wie“ von Protokollen in Swift. Auch andere, zum Verständnis der Beispiele notwendige Ansätze (z. B. MVVM) in der (Swift UI)-Programmierung werden kurz dargestellt. Die Playground-Übungen sind gut nachvollziehbar und erläutert.
Es geht also um einen der grundlegenden Ansätze der Swift-Programmierung, der speziell in Swift UI ein tragender Baustein ist und der leider trotzdem (zumindest für mich) in anderen Lehrbüchern zwar theoretisch behandelt, als praktisches Tool aber immer eine universale, quergestrebte Reduziermuffe geblieben ist: Ist überall drin, das Ganze funktioniert auch klasse, aber wozu??
MEIN LESEERGEBNIS: Nach dem Durcharbeiten der Kapitel 1-5, die einem die Prinzipien des Umgangs mit Protokollen theoretisch und praktisch nahebringen, hat sich meine Sicht und mein Herangehen an die App-Programmierung definitiv geändert und ist klarer geworden.
Ich werde in Zukunft in meinen Programmen konsequenter Protokolle einsetzen und den Programmaufbau auch daran ausrichten!
Leider hatte ich dann beim Nachvollziehen der Programmierung der abschließenden Reale Welt-App in Kapitel 6 das Gefühl, dass andere Dinge in diesem Beispiel viel wichtiger sind (MVVM-Architektur, asynchrones Datenfetching und -verarbeitung mittels URLs und JSON, Fehlerbehandlung …) und man besser darüber ein Buch gelesen hätte.
Deshalb fehlt der fünfte Stern.
PS: Ich habe mir auf jeden Fall auch das Buch über Design Patterns gekauft!