Overview of an approach to iOS application architecture called VIPER. VIPER is an application of clean architecture to iOS apps that is considerate of the fact that UIKit and Cocoa Touch are the main tools that iOS apps are built on top of.
Infinum iOS Talks #4 - Making our VIPER more reactiveInfinum
The document discusses Reactive VIPER and RxSwift. It introduces the VIPER architecture, which splits up the view controller into four main components: view, interactor, presenter, and wireframe. RxSwift is described as a library that uses functional reactive programming concepts to provide a declarative way to compose and transform observable sequences. Some key benefits of RxSwift mentioned are that it unifies various design patterns, enables building apps in a declarative reactive style, and treats observers and iterators as mathematical duals.
Why the Dark Side should use Swift and a SOLID ArchitectureJorge Ortiz
The document discusses how adopting a SOLID architecture and design patterns can help address weaknesses of the "Dark Side" like lack of robustness, testability, and team collaboration. It promotes using SOLID principles like single responsibility, open/closed, Liskov substitution, and dependency inversion. Examples show applying these principles through concepts like entities, use cases, presenters, and segregating interfaces. Adopting these practices leads to code that is more reusable, flexible, and replaceable.
Jorge D. Ortiz Fuentes "Hands on Implementation of Clean Architecture for And...IT Event
- Implementation of the Interactor
Implement the first user story: show a list of data elements to the user. Define the first version of the immutable entities and transform them into immutable objects with the data to display.
- Implementation of the Presenter/event handler
Creation of the presenter that will talk to the view and present the data.
- Implementation of the View
How to make a dumb, but still useful view.
- A basic implementation of the entity gateway
Defer the decision of the persistence framework for later. Implement the minimum functionality in a basic object. Implications of the repository pattern.
- Connect the pieces and make it all work
Understand the way the pieces are interconnected and its memory management implications. Implement the required object and make it work.
- Proper connections. Writing a reusable way to connect the pieces and navigate.
- Review, Questions & Answers.
This document compares and summarizes several mobile app architectures: MVC, MVP, MVVM, VIPER, and VIP. It describes how each architecture distributes responsibilities, enables testability, and considers ease of use. MVC is criticized for tight coupling between views and controllers. MVP and MVVM improve on this with separation of concerns. VIPER and VIP further separate responsibilities into modular components with clear roles. Overall, the document evaluates these architectures based on balancing responsibilities, enabling testability, and maintaining a low maintenance cost.
This document discusses implementing Clean Architecture in iOS apps. It provides an agenda for a training on the topic, including understanding Clean Architecture concepts, implementing rules, and an example app called RealProgrammers. The first user story of displaying a list of programmers is implemented as an example, including defining the interactor, presenter and view components and their responsibilities, as well as the entity gateway.
The document discusses using protocol buffers (Protobuf) and code generation to reduce boilerplate code when developing microservices with the Go kit framework. It provides an example of defining a service in Protobuf and generating Go code for the service endpoints, transports, and registration functions using a custom code generation tool called protoc-gen-gotemplate. The tool reads Protobuf service definitions and template files to generate standardized, up-to-date Go code that implements the services while avoiding much of the repetitive code normally required.
Infinum iOS Talks #4 - Making our VIPER more reactiveInfinum
The document discusses Reactive VIPER and RxSwift. It introduces the VIPER architecture, which splits up the view controller into four main components: view, interactor, presenter, and wireframe. RxSwift is described as a library that uses functional reactive programming concepts to provide a declarative way to compose and transform observable sequences. Some key benefits of RxSwift mentioned are that it unifies various design patterns, enables building apps in a declarative reactive style, and treats observers and iterators as mathematical duals.
Why the Dark Side should use Swift and a SOLID ArchitectureJorge Ortiz
The document discusses how adopting a SOLID architecture and design patterns can help address weaknesses of the "Dark Side" like lack of robustness, testability, and team collaboration. It promotes using SOLID principles like single responsibility, open/closed, Liskov substitution, and dependency inversion. Examples show applying these principles through concepts like entities, use cases, presenters, and segregating interfaces. Adopting these practices leads to code that is more reusable, flexible, and replaceable.
Jorge D. Ortiz Fuentes "Hands on Implementation of Clean Architecture for And...IT Event
- Implementation of the Interactor
Implement the first user story: show a list of data elements to the user. Define the first version of the immutable entities and transform them into immutable objects with the data to display.
- Implementation of the Presenter/event handler
Creation of the presenter that will talk to the view and present the data.
- Implementation of the View
How to make a dumb, but still useful view.
- A basic implementation of the entity gateway
Defer the decision of the persistence framework for later. Implement the minimum functionality in a basic object. Implications of the repository pattern.
- Connect the pieces and make it all work
Understand the way the pieces are interconnected and its memory management implications. Implement the required object and make it work.
- Proper connections. Writing a reusable way to connect the pieces and navigate.
- Review, Questions & Answers.
This document compares and summarizes several mobile app architectures: MVC, MVP, MVVM, VIPER, and VIP. It describes how each architecture distributes responsibilities, enables testability, and considers ease of use. MVC is criticized for tight coupling between views and controllers. MVP and MVVM improve on this with separation of concerns. VIPER and VIP further separate responsibilities into modular components with clear roles. Overall, the document evaluates these architectures based on balancing responsibilities, enabling testability, and maintaining a low maintenance cost.
This document discusses implementing Clean Architecture in iOS apps. It provides an agenda for a training on the topic, including understanding Clean Architecture concepts, implementing rules, and an example app called RealProgrammers. The first user story of displaying a list of programmers is implemented as an example, including defining the interactor, presenter and view components and their responsibilities, as well as the entity gateway.
The document discusses using protocol buffers (Protobuf) and code generation to reduce boilerplate code when developing microservices with the Go kit framework. It provides an example of defining a service in Protobuf and generating Go code for the service endpoints, transports, and registration functions using a custom code generation tool called protoc-gen-gotemplate. The tool reads Protobuf service definitions and template files to generate standardized, up-to-date Go code that implements the services while avoiding much of the repetitive code normally required.
The base architecture of iOS is MVC (Model View Controller) which leads into known as Massive View Controller, where the View Controllers end up doing so many logic. It is easy to mix UI code and business logic together which is the wrong way to test the logic.
VIPER is one of a modern architecture made for this issue. It is based by Uncle Bob's Clean Architecture. It use the Separation of Concern principle which make the code cleaner and easy to maintenance.
The document discusses how web applications have evolved since 1993 and provides recommendations for a cleaner architecture. It addresses how web apps used to be developed with a clear separation between the user interface, business logic, and data access layers, but over time these boundaries became blurred as apps put more code on the client-side. The document advocates returning to separating an app's concerns into independent layers for easier maintenance and more flexibility.
A journey from MVC to VIPER is a try to leverage different application architectures (as well as some concepts on top of MVC) to build more clean and readable software in Cocoa. Most of the described techniques can be successfully used while dealing with legacy codebase.
VIPER is an iOS app architecture that separates an app into five components: Views, Interactors, Presenters, Entities, and Routers. This improves upon massive View Controllers by dividing responsibilities between layers. The View layer handles display, the Interactor handles business logic, the Presenter links Views and Interactors, Entities manage data, and the Router manages navigation. A sample journal app is described to demonstrate how VIPER would structure its components.
O documento descreve o padrão arquitetural VIPER, que promove uma arquitetura limpa dividida em módulos com único propósito. Inicialmente, mostra como dividir uma classe Car em DrivableCar, MaintainableCar e ComfortableCar para seguir o princípio da responsabilidade única. Posteriormente, introduz os papéis View, Presenter, Interactor, Entity e Router para organizar a arquitetura em camadas.
There's another talk about Clean Architecture, SOLID, and our approach at InfoJobs. If you need the slides, don't hesitate to fork https://github.com/schibsted-android-training/workshop-5
This document discusses clean architecture, which aims to separate an application into distinct layers. The core application logic is separated from the user interface and database access. This improves testability and flexibility. Some benefits of clean architecture include excellent testability since each component can be tested in isolation, clearly defined separation of concerns, and flexibility to change parts of the application independently. However, there are also costs like increased complexity with more classes and data conversions between layers.
The document discusses iOS project structure and design patterns. It recommends using the Model-View-Controller (MVC) pattern to structure iOS projects. MVC separates an app's data model, user interface, and logic into three distinct components. The view handles display and user interaction, the controller manages changes and updates, and the model manages the data and business logic. CoreData is recommended for storing partial object graphs and including data concurrency. Key-Value Observing (KVO) allows objects to automatically notify observers of property value changes.
Predavanje iz predmeta Principi softverskog inženjerstva, sa beogradskog ETF-a.
Svi materijali su javno dostupni i nalaze se ovde: http://si3psi.etf.rs/
Lekcija 11 ukljucuje praktican primjer gradiva naucenog kroz prethodna predavanja: dizajn baze, povezivanje PHP sa bazom, unos recorda kroz interface, njegov ispis, jednostavan MVC model, inheritence, petlje kao i osnovni error handling. Praktican primjer je dizajn jednostavnog blog website-a.
Presentation held at the Faculty of Organizational Sciences in Belgrade, Serbia, 17th may 2012.
Organized by FONIS (http://fonis.rs/vest.php?id=287)
My take at Android vs iOS.
O novoj implementaciji .NET platforme - .NET Core. Modularna, otvorenog koda, a osim na Windows mašinama živi i na Linuxu i Macu. Što sve trebamo znati o .NET Coreu, kakav je odnos s postojećim platformama te zašto nas uopće treba biti briga.
Infinum Android Talks #20 - Making your Android apps fast like Blue Runner an...Infinum
There always comes a point in an Android developer’s life when an application stops running perfectly and stutters a bit. Or uses too much memory. Or even hangs! In this talk, we'll take a look at all the tools that can help you figure out what makes your application cough, stutter and eat too much memory.
The base architecture of iOS is MVC (Model View Controller) which leads into known as Massive View Controller, where the View Controllers end up doing so many logic. It is easy to mix UI code and business logic together which is the wrong way to test the logic.
VIPER is one of a modern architecture made for this issue. It is based by Uncle Bob's Clean Architecture. It use the Separation of Concern principle which make the code cleaner and easy to maintenance.
The document discusses how web applications have evolved since 1993 and provides recommendations for a cleaner architecture. It addresses how web apps used to be developed with a clear separation between the user interface, business logic, and data access layers, but over time these boundaries became blurred as apps put more code on the client-side. The document advocates returning to separating an app's concerns into independent layers for easier maintenance and more flexibility.
A journey from MVC to VIPER is a try to leverage different application architectures (as well as some concepts on top of MVC) to build more clean and readable software in Cocoa. Most of the described techniques can be successfully used while dealing with legacy codebase.
VIPER is an iOS app architecture that separates an app into five components: Views, Interactors, Presenters, Entities, and Routers. This improves upon massive View Controllers by dividing responsibilities between layers. The View layer handles display, the Interactor handles business logic, the Presenter links Views and Interactors, Entities manage data, and the Router manages navigation. A sample journal app is described to demonstrate how VIPER would structure its components.
O documento descreve o padrão arquitetural VIPER, que promove uma arquitetura limpa dividida em módulos com único propósito. Inicialmente, mostra como dividir uma classe Car em DrivableCar, MaintainableCar e ComfortableCar para seguir o princípio da responsabilidade única. Posteriormente, introduz os papéis View, Presenter, Interactor, Entity e Router para organizar a arquitetura em camadas.
There's another talk about Clean Architecture, SOLID, and our approach at InfoJobs. If you need the slides, don't hesitate to fork https://github.com/schibsted-android-training/workshop-5
This document discusses clean architecture, which aims to separate an application into distinct layers. The core application logic is separated from the user interface and database access. This improves testability and flexibility. Some benefits of clean architecture include excellent testability since each component can be tested in isolation, clearly defined separation of concerns, and flexibility to change parts of the application independently. However, there are also costs like increased complexity with more classes and data conversions between layers.
The document discusses iOS project structure and design patterns. It recommends using the Model-View-Controller (MVC) pattern to structure iOS projects. MVC separates an app's data model, user interface, and logic into three distinct components. The view handles display and user interaction, the controller manages changes and updates, and the model manages the data and business logic. CoreData is recommended for storing partial object graphs and including data concurrency. Key-Value Observing (KVO) allows objects to automatically notify observers of property value changes.
Predavanje iz predmeta Principi softverskog inženjerstva, sa beogradskog ETF-a.
Svi materijali su javno dostupni i nalaze se ovde: http://si3psi.etf.rs/
Lekcija 11 ukljucuje praktican primjer gradiva naucenog kroz prethodna predavanja: dizajn baze, povezivanje PHP sa bazom, unos recorda kroz interface, njegov ispis, jednostavan MVC model, inheritence, petlje kao i osnovni error handling. Praktican primjer je dizajn jednostavnog blog website-a.
Presentation held at the Faculty of Organizational Sciences in Belgrade, Serbia, 17th may 2012.
Organized by FONIS (http://fonis.rs/vest.php?id=287)
My take at Android vs iOS.
O novoj implementaciji .NET platforme - .NET Core. Modularna, otvorenog koda, a osim na Windows mašinama živi i na Linuxu i Macu. Što sve trebamo znati o .NET Coreu, kakav je odnos s postojećim platformama te zašto nas uopće treba biti briga.
Infinum Android Talks #20 - Making your Android apps fast like Blue Runner an...Infinum
There always comes a point in an Android developer’s life when an application stops running perfectly and stutters a bit. Or uses too much memory. Or even hangs! In this talk, we'll take a look at all the tools that can help you figure out what makes your application cough, stutter and eat too much memory.
We're taking a closer look into a new utility class from Android Support Library. It enables you to calculate the difference between two lists and output a list of update operations swiftly and with style. Presented by Željko Plesac from Infinum.
Infinum Android Talks #20 - Benefits of using KotlinInfinum
After this talk, using plain old Java for Android development will no longer be good enough for you. You have been warned. Presented by Dino Kovač from Infinum.
Infinum iOS Talks #4 - Making your Swift networking code more awesome with Re...Infinum
Advantages of using Result<value,> values (similar to Swift’s native Optional type) in your networking code. Learn how Result helps you handle errors better and takes advantage of functional patterns.
Infinum Android Talks #13 - Using ViewDragHelperInfinum
You probably haven't heard about ViewDragHelper class but if you want to drag things around your screen you will need it. In this lecture we will show you how and why you should use it.
Log4j is a logging library developed by Apache. It makes logging simple and effective. In this lecture we will show you the setup process and some of its main features.
Infinum Android Talks #9 - Making your app location-awareInfinum
AwareWhen app requires knowledge about user location and places around him you don't want to struggle with details of the underlying location technology. In this talk, you will learn how to make your life easier with the new Fused Location Provider API.
Gradle is great for creating automated build tasks. We will explain why and how to code your own gradle plugins and make your build code reusable across projects.
Infinum Android Talks #14 - Facebook for Android APIInfinum
Facebook is the world's largest open access repository of user data. We'll show you have to connect Android applications with Facebook and use its rich API to enhance user experience.
Infinum Android Talks #19 - Stop wasting time fixing bugs with TDD by Domagoj...Infinum
1. This document discusses how test-driven development (TDD) using tools like Robolectric, Dagger, and Mock Web Server can help fix bugs and develop Android applications more efficiently.
2. It describes the author's experience transitioning from not writing any tests to learning how to implement TDD for a new project using these tools.
3. Advice is provided on how to get started with TDD, including creating layouts, writing tests before application logic, and being able to debug and mock responses while developing features faster.
Infinum Android Talks #18 - Create fun lists by Ivan MarićInfinum
Creating list screens got amazing with the release of the RecyclerView widget. Of course, this also means more work. Ivan will show you some tips and tricks on how to add animations on list items and make them more pleasing to the eye and fun for the user.
Infinum Android Talks #18 - In-app billing by Ivan MarićInfinum
You’re experienced in building Android apps but have trouble with the conversion rate? Ivan will talk about the monetization models Google Play offers and demonstrate how to use them in your apps.
Infinum iOS Talks #2 - VIPER for everybody by Damjan VujaklijaInfinum
We'll do a short overview of VIPER and then we'll cover our customized version of VIPER. We will discuss our project and module generator tools, numerous tips and tweaks which will make VIPER more accessible and easier to use without sacrificing its main features.
Infinum iOS Talks #2 - Xamarin by Ivan ĐikićInfinum
The document discusses three common approaches to mobile app development: native, hybrid, and Xamarin. It focuses on explaining the Xamarin approach. Key points:
- Xamarin allows writing apps in C# that can target iOS and Android from a single codebase.
- It works by compiling to a common language runtime and using platform invocation to call native platform APIs.
- Developers get access to the full native platform functionality while sharing most of the app's code across platforms.
Infinum iOS Talks #1 - Swift under the hood: Method Dispatching by Vlaho PolutaInfinum
This document discusses method dispatching in Swift. It explains that method dispatch determines which method is invoked in response to a message. In C++ and Objective-C, methods can use static or dynamic dispatch. Static dispatch is determined at compile-time, while dynamic dispatch is determined at runtime. The document also shows how Swift can generate Objective-C classes and use the runtime, with Swift classes being Objective-C classes under the hood. It demonstrates through benchmarks that Swift code can be as fast or faster than equivalent Objective-C code.
Infinum iOS Talks #1 - Swift done right by Ivan DikicInfinum
The document discusses four main pillars of Swift programming: value types, higher-order functions, protocols, and generics. For value types, it explains that structs and enums keep unique copies of data unlike classes which share data. It provides examples of higher-order functions like map, filter and reduce. Protocols are described as a way to achieve composition over inheritance in Swift. Generics allow writing type-agnostic code through placeholders like <T>. Optionals represent the concept of nothingness in Swift by allowing a type to hold either a value or nothing.
Infinum Android Talks #17 - Testing your Android applications by Ivan KustInfinum
van will show you how to setup unit tests using Robolectric, how to test user interactions using Espresso and provide some tips and tricks for stress-free testing.
Infinum Android Talks #17 - A quest for WebSockets by Zeljko PlesacInfinum
Željko will take a closer look into available WebSocket solutions for Android and demonstrate how switching between them using a decoupled architecture and Dagger 2 can be simple and intuitive.
2. Sadržaj
2
• Najčešći problemi u arhitekturi iOS aplikacija
• Arhitektura zasnovana na use caseovima
• VIPER
• Zaključak
3. 3
Najčešći problemi u arhitekturi iOS
aplikacija
• Masivni kontroleri
• Kontrolerima je pridjeljeno previše
odgovornosti
• MVC (logika za koju nije očito kamo pripada
završi uglavnom u kontroleru)
4. Arhitektura zasnovana na use caseovima
• Svaki use case ima svoj modul
• Moduli imaju jasno definiranu strukturu (VIPER)
• Standarni komunikacijski obrasci (delegacija,
notifikacije …)
4
5. 5
Arhitektura zasnovana na use caseovima
protocol LoginModuleInterface {
func loginWithUsername(username:String, password:String)
func signUpWithUsername(username:String, password:String)
}
9. Entity
• Domenski objekti
• Samo interaktor može manipulirati domenskim
objektima
• Domenski objekti se ne bi trebali prosljeđivati
presenteru
9
10. Presenter
10
• Zna kada treba prikazati korisničko sučelje
• Priprema podatke za prikaz na UI
• Prima inpute iz UI-a
• Mediator između view-a i interaktora
11. 11
Presenter
class LoginPresenter: NSObject, LoginModuleInterface, LoginInteractorOutput {
var rootRouter: RootRouter?
var userInterface: LoginViewInterface?
var loginInteractor: LoginInteractor?
…
}
12. View
! Trebao bi biti glup i pasivan
! Nikada ne traži podatke od Presentera
! Presenter mu prosljeđuje podatke preko jasno
definiranog sučelja
12