SlideShare una empresa de Scribd logo
1 de 27
Descargar para leer sin conexión
MVVM
Robert Brown
@robby_brown
@robert_brown
@rob-brown
Outline
1. Core Data
2. Reactive Cocoa
3. MVVM
Core Data
What is Core Data?
Intimidating
An amazing data persistence framework
Not a database
Core Data Layers
XML SQLite Binary In Memory Custom
NSPersistentStore
NSPersistentStoreCoordinator NSManagedObjectModel
NSManagedObjectContext
NSManagedObject
Application
NSManagedObject Subclass
Core Data Stack
Persistent Store
Coordinator
Managed Object
Context(s)
Persistent Store(s)
Managed
Object Model
More on Core Data
Intro to Core Data
Core Data: Data Storage Management for iOS, OS X,
and iCloud
RBCoreDataStack
Reactive Cocoa
What is Reactive Cocoa?
Made by GitHub
A functional reactive programming (FRP) framework
Provides the bindings in MVVM
What is Reactive Cocoa?
Binds properties together
Eliminates the need for mutable state
UI updates automatically as data changes
More on Reactive Cocoa
Intro to Reactive Cocoa
Functional Reactive Programming on iOS
ReactiveCocoa
MVVM
What is MVVM?
Model-View-ViewModel
A variant of MVC
Uses an adapter between the view and model
What is MVVM?
View
View
Model
Model
Owns Owns
UpdatesUpdates
What is MVVM?
Data Model
ViewModel Network
ViewController
View
Data Storage
Application Stack
ViewModel Network
ViewController
View
SQLite Binary In Memory Custom
NSPersistentStore
NSPersistentStoreCoordinator NSManagedObjectModel
NSManagedObjectContext
NSManagedObject
NSManagedObject Subclass
XML
Model
Represents the data layer
Can be built with any technology
Ex. Core Data, SQLite, JSON, PList, memory-only
View
Handles layout and presentation of data
In iOS, the “View” refers to both UIViews and
UIViewControllers
ViewModel
An adapter between the View and Model
Contains all the business logic
Uses bindings to pass data around
ViewModel
Acts like a model
Hides the real model logic from the view
ViewModel
Some responsibilities:
Kick off network and database requests
Show/hide information
Data/number formatting
Localization
Benefits of MVVM
View models are testable
View models can be used like models
View models are (mostly) platform-agnostic
View and view controllers are simpler
Related Patterns
Model Operation View Event (MOVE)
Model View Presenter (MVP)
Presentation Model (PM)
Questions?
Demo
Want to Learn More?
ReactiveViewModel
Functional Reactive Programming on iOS
Wikipedia
Want to Learn More?
!
Ash Furrow
C-41
Functional Reactive Pixels

Más contenido relacionado

La actualidad más candente

Modern JavaScript Development @ DotNetToscana
Modern JavaScript Development @ DotNetToscanaModern JavaScript Development @ DotNetToscana
Modern JavaScript Development @ DotNetToscana
Matteo Baglini
 
My sql with java
My sql with javaMy sql with java
My sql with java
oly07104
 

La actualidad más candente (13)

Modern JavaScript Development @ DotNetToscana
Modern JavaScript Development @ DotNetToscanaModern JavaScript Development @ DotNetToscana
Modern JavaScript Development @ DotNetToscana
 
Spring 4 en spring data
Spring 4 en spring dataSpring 4 en spring data
Spring 4 en spring data
 
Jdbc
Jdbc   Jdbc
Jdbc
 
google gwt
google gwtgoogle gwt
google gwt
 
My sql with java
My sql with javaMy sql with java
My sql with java
 
JavaScript Fundamentals
JavaScript FundamentalsJavaScript Fundamentals
JavaScript Fundamentals
 
EJB 3.0 course Sildes and matrial
EJB 3.0 course Sildes and matrialEJB 3.0 course Sildes and matrial
EJB 3.0 course Sildes and matrial
 
Postgres seminar
Postgres seminarPostgres seminar
Postgres seminar
 
3rd Generation Web Application Platforms
3rd Generation Web Application Platforms3rd Generation Web Application Platforms
3rd Generation Web Application Platforms
 
Jsfsunum
JsfsunumJsfsunum
Jsfsunum
 
[Srijan Wednesday Webinars] The Fundamentals of ReactJS
[Srijan Wednesday Webinars] The Fundamentals of ReactJS[Srijan Wednesday Webinars] The Fundamentals of ReactJS
[Srijan Wednesday Webinars] The Fundamentals of ReactJS
 
Introduction to Akka
Introduction to AkkaIntroduction to Akka
Introduction to Akka
 
Elements for an iOS Backend
Elements for an iOS BackendElements for an iOS Backend
Elements for an iOS Backend
 

Similar a MVVM

MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB for Java Devs with Spring Data - MongoPhilly 2011MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB
 
3 Reasons to Love React
3 Reasons to Love React3 Reasons to Love React
3 Reasons to Love React
Victor Leung
 
InstructionsFor decades, relational databases remained essential.docx
InstructionsFor decades, relational databases remained essential.docxInstructionsFor decades, relational databases remained essential.docx
InstructionsFor decades, relational databases remained essential.docx
normanibarber20063
 
Backbone introdunction
Backbone introdunctionBackbone introdunction
Backbone introdunction
mzxbupt
 

Similar a MVVM (20)

Spring (1)
Spring (1)Spring (1)
Spring (1)
 
Core Data
Core DataCore Data
Core Data
 
Using MongoDB to Build a Fast and Scalable Content Repository
Using MongoDB to Build a Fast and Scalable Content RepositoryUsing MongoDB to Build a Fast and Scalable Content Repository
Using MongoDB to Build a Fast and Scalable Content Repository
 
Spring 3.1: a Walking Tour
Spring 3.1: a Walking TourSpring 3.1: a Walking Tour
Spring 3.1: a Walking Tour
 
BackboneJS + ReactJS
BackboneJS + ReactJSBackboneJS + ReactJS
BackboneJS + ReactJS
 
Free Hibernate Tutorial | VirtualNuggets
Free Hibernate Tutorial  | VirtualNuggetsFree Hibernate Tutorial  | VirtualNuggets
Free Hibernate Tutorial | VirtualNuggets
 
MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB for Java Devs with Spring Data - MongoPhilly 2011MongoDB for Java Devs with Spring Data - MongoPhilly 2011
MongoDB for Java Devs with Spring Data - MongoPhilly 2011
 
Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller Enterprise Java in 2012 and Beyond, by Juergen Hoeller
Enterprise Java in 2012 and Beyond, by Juergen Hoeller
 
P20CSP105-AdvJavaProg.pptx
P20CSP105-AdvJavaProg.pptxP20CSP105-AdvJavaProg.pptx
P20CSP105-AdvJavaProg.pptx
 
Getting started with entity framework
Getting started with entity framework Getting started with entity framework
Getting started with entity framework
 
Virtual classroom
Virtual classroomVirtual classroom
Virtual classroom
 
Rollin onj Rubyv3
Rollin onj Rubyv3Rollin onj Rubyv3
Rollin onj Rubyv3
 
Introduction To J Boss Seam
Introduction To J Boss SeamIntroduction To J Boss Seam
Introduction To J Boss Seam
 
3 Reasons to Love React
3 Reasons to Love React3 Reasons to Love React
3 Reasons to Love React
 
InstructionsFor decades, relational databases remained essential.docx
InstructionsFor decades, relational databases remained essential.docxInstructionsFor decades, relational databases remained essential.docx
InstructionsFor decades, relational databases remained essential.docx
 
NoSql Databases
NoSql DatabasesNoSql Databases
NoSql Databases
 
A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom A Walking Tour of (almost) all of Springdom
A Walking Tour of (almost) all of Springdom
 
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...
Streaming Movies brings you Streamlined Applications -- How Adopting Netflix ...
 
Backbone introdunction
Backbone introdunctionBackbone introdunction
Backbone introdunction
 
Moving from Relational to Document Store
Moving from Relational to Document StoreMoving from Relational to Document Store
Moving from Relational to Document Store
 

Más de Robert Brown

Más de Robert Brown (13)

High level concurrency
High level concurrencyHigh level concurrency
High level concurrency
 
Data Source Combinators
Data Source CombinatorsData Source Combinators
Data Source Combinators
 
Elixir
ElixirElixir
Elixir
 
Reactive Cocoa
Reactive CocoaReactive Cocoa
Reactive Cocoa
 
UIKit Dynamics
UIKit DynamicsUIKit Dynamics
UIKit Dynamics
 
iOS State Preservation and Restoration
iOS State Preservation and RestorationiOS State Preservation and Restoration
iOS State Preservation and Restoration
 
Anti-Patterns
Anti-PatternsAnti-Patterns
Anti-Patterns
 
Pragmatic blocks
Pragmatic blocksPragmatic blocks
Pragmatic blocks
 
Automatic Reference Counting
Automatic Reference CountingAutomatic Reference Counting
Automatic Reference Counting
 
Grand Central Dispatch Design Patterns
Grand Central Dispatch Design PatternsGrand Central Dispatch Design Patterns
Grand Central Dispatch Design Patterns
 
Grand Central Dispatch
Grand Central DispatchGrand Central Dispatch
Grand Central Dispatch
 
Mac/iOS Design Patterns
Mac/iOS Design PatternsMac/iOS Design Patterns
Mac/iOS Design Patterns
 
Quick Look for iOS
Quick Look for iOSQuick Look for iOS
Quick Look for iOS
 

Último

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Último (20)

Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
A Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source MilvusA Beginners Guide to Building a RAG App Using Open Source Milvus
A Beginners Guide to Building a RAG App Using Open Source Milvus
 

MVVM