SlideShare une entreprise Scribd logo
1  sur  27
Télécharger pour lire hors ligne
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

Contenu connexe

Tendances

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
 

Tendances (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
 

Similaire à 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
 

Similaire à 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
 

Plus de Robert Brown

Plus 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
 

Dernier

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Dernier (20)

Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
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...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 

MVVM