SlideShare a Scribd company logo
1 of 20
Blah blah
Blah blah
Blah blah
Blah blah !!!!#$!
App Store 2008:
-connected apps, showing real
time data! Whoa Nelly!
- in your pocket! Boom!
Communication OK?
XML? CSV? binary?
<myverylongtagname>
1
</myverylongtagname>
MyName, 1, 2, 5, left, TRUE
Other, 5, 4, 3, left, FALSE
0100001001100101001000
0001110011011101010111
0010011001010010000001
110100011011110
JSON
JSON is awesome
1) it’s very SIMPLE!
2) supported by tons of languages
3) structural data
• Step1: Stackoverflow
• Step2: click the link in approved answer
• Step3:
•
How to JSON?
Simplest approach
[[[[[json objectForKey:@”name”] objectAtIndex:1]
objectAtIndex: 2] objectForKey:@”value”] boolValue]
2009 code
2013 code
[json[@”name”][1][2][@”value”] boolValue]
never!
- json ... is nil ...
- EXC_BAD_ACCESS
- ... unrecognized selector ... [NSString boolValue]
- ... index out of bounds ...
Pros & Cons
• very quick code turnaround!!!
• no structure validation
• no data validation
• difficult to error handle
• it’s the road to maintenance
HELL!
evolution indicator
A better way!
NSDictionary* json = [NSJSONSerialization ... ];
if (json == nil) [self errorHandleEmptyJSON];
if (json[@”name”] == nil)
[self errorHandleEmptyName];
NSArray* name = json[@”name”];
if (name.count<1]
[self errorHandleWrongJSONStructure];
NSNumber* value = name[1][2][@”value”];
Forget much? oh noes...
Looks good so far, what’s left?
- validate the data for all values you use
- check if the incoming objects are of the
expected class type (yuicks!)
- make sure you decend into the JSON
according to the incoming structure
Pros & cons?
• Horribly slow to write code
• Difficult to maintain
• How do you recover from errors
in the middle of the parsing process???
• Better data validation
• Better structure validation
evolution indicator
Data models?
The “M” in MVC stands
for “MODEL”
Wrap up all the code in
classes for all your models
feels good!
Your models feature custom init
which reads the JSON and builds
up the model representation
All IF statements and all the error
handling is handled within the
model class
Other magic you coded at 4.17am on a Thursday
Pros & cons
• Using a class instead of NSDictionary
• OOP 4 Ever!
• Very flexible code
• Lot of redundant parsing code
• Lot of implementation
• Still harder to adapt to changes
evolution indicator
Then what?
Throughout 2012 I worked
mainly on JSON powered
applications.
In December I was already
fed-up with:
self.name = json[@”name”];
Eureka!
JSONModel
- import JSON
- structure validation
- data type validation
- data type conversion
- atomic operations
- error handling
Automatically does/has:
Import JSON
.h .m
For relatively simple models eliminates
the need to code in your .m file
Validation
@property (strong, nonatomic) NSString* name;
What you want is:
What you should be
getting might be:
{“name”:“Name”}
It is about what you want to have!
Conversion
@property (strong, nonatomic) NSURL* blogSiteUrl;
What you want is:
What you get is:
{“blogSiteUrl”:“http://www.yahoo.com”}
It is about what you want to have!
JSONModel
evolution indicator
Takes the hum-drum out of
coding
It’s very fast
Growing (testing) fan base
Thanks
www.JSONModel.com
Image credits:
http://www.clker.com
http://clipart.christiansunite.com
http://office.microsoft.com

More Related Content

Viewers also liked

Some Successful Rabo Development Projects : Focus on Mobile
Some Successful Rabo Development Projects : Focus on MobileSome Successful Rabo Development Projects : Focus on Mobile
Some Successful Rabo Development Projects : Focus on MobileDan Armstrong
 
Mobile Financial Services - IBC / Singapore
Mobile Financial Services - IBC / SingaporeMobile Financial Services - IBC / Singapore
Mobile Financial Services - IBC / SingaporeDan Armstrong
 
Mobile Financial Services Distribution: Partnerships, Alliances & Joint-Ventures
Mobile Financial Services Distribution: Partnerships, Alliances & Joint-VenturesMobile Financial Services Distribution: Partnerships, Alliances & Joint-Ventures
Mobile Financial Services Distribution: Partnerships, Alliances & Joint-VenturesDan Armstrong
 
Mobile Banking & Rabo Development Partner Banks
Mobile Banking & Rabo Development Partner BanksMobile Banking & Rabo Development Partner Banks
Mobile Banking & Rabo Development Partner BanksDan Armstrong
 
Mobile Convention Amsterdam - 22 May 2013
Mobile Convention Amsterdam - 22 May 2013Mobile Convention Amsterdam - 22 May 2013
Mobile Convention Amsterdam - 22 May 2013Dan Armstrong
 
Future of Web 2.0 - talk, 22 September 2009
Future of Web 2.0 - talk, 22 September 2009Future of Web 2.0 - talk, 22 September 2009
Future of Web 2.0 - talk, 22 September 2009Dan Armstrong
 
Rabo Development Retail Distribution & Channel Strategies & Successes
Rabo Development Retail Distribution & Channel Strategies & Successes Rabo Development Retail Distribution & Channel Strategies & Successes
Rabo Development Retail Distribution & Channel Strategies & Successes Dan Armstrong
 
Banking Distribution Overview
Banking Distribution OverviewBanking Distribution Overview
Banking Distribution OverviewDan Armstrong
 
M-Commerce World Summit 2011 - Introduction
M-Commerce World Summit 2011 - IntroductionM-Commerce World Summit 2011 - Introduction
M-Commerce World Summit 2011 - IntroductionDan Armstrong
 
Rabo Mobiel & NMB Mobile: Mobile Banking & Payments Development
Rabo Mobiel & NMB Mobile: Mobile Banking & Payments DevelopmentRabo Mobiel & NMB Mobile: Mobile Banking & Payments Development
Rabo Mobiel & NMB Mobile: Mobile Banking & Payments DevelopmentDan Armstrong
 
techMAP Amsterdam: What's trending in 2012? A focus on SOLOMO
techMAP Amsterdam: What's trending in 2012? A focus on SOLOMOtechMAP Amsterdam: What's trending in 2012? A focus on SOLOMO
techMAP Amsterdam: What's trending in 2012? A focus on SOLOMODan Armstrong
 
The Consumer Side of NFC and Mobile Payments
The Consumer Side of NFC and Mobile PaymentsThe Consumer Side of NFC and Mobile Payments
The Consumer Side of NFC and Mobile PaymentsDan Armstrong
 
Mobey Forum - Case Study: Banking the Banked with NMB Mobile
Mobey Forum - Case Study: Banking the Banked with NMB MobileMobey Forum - Case Study: Banking the Banked with NMB Mobile
Mobey Forum - Case Study: Banking the Banked with NMB MobileDan Armstrong
 
Mobile Banking & Payments Update: September 2010
Mobile Banking & Payments Update: September 2010Mobile Banking & Payments Update: September 2010
Mobile Banking & Payments Update: September 2010Dan Armstrong
 
Rabo Development & Sustainable Distribution
Rabo Development & Sustainable DistributionRabo Development & Sustainable Distribution
Rabo Development & Sustainable DistributionDan Armstrong
 
Rabo Development Retail Distribution Case Study: Mobile Banking and Payments
Rabo Development Retail Distribution Case Study: Mobile Banking and PaymentsRabo Development Retail Distribution Case Study: Mobile Banking and Payments
Rabo Development Retail Distribution Case Study: Mobile Banking and PaymentsDan Armstrong
 
Africa - Mobile Convention Amsterdam
Africa - Mobile Convention AmsterdamAfrica - Mobile Convention Amsterdam
Africa - Mobile Convention AmsterdamDan Armstrong
 
Mobile Payments & Banking - NACHA Global Payments Forum
Mobile Payments & Banking - NACHA Global Payments ForumMobile Payments & Banking - NACHA Global Payments Forum
Mobile Payments & Banking - NACHA Global Payments ForumDan Armstrong
 

Viewers also liked (19)

Some Successful Rabo Development Projects : Focus on Mobile
Some Successful Rabo Development Projects : Focus on MobileSome Successful Rabo Development Projects : Focus on Mobile
Some Successful Rabo Development Projects : Focus on Mobile
 
Mobile Financial Services - IBC / Singapore
Mobile Financial Services - IBC / SingaporeMobile Financial Services - IBC / Singapore
Mobile Financial Services - IBC / Singapore
 
Mobile Financial Services Distribution: Partnerships, Alliances & Joint-Ventures
Mobile Financial Services Distribution: Partnerships, Alliances & Joint-VenturesMobile Financial Services Distribution: Partnerships, Alliances & Joint-Ventures
Mobile Financial Services Distribution: Partnerships, Alliances & Joint-Ventures
 
Mobile Banking & Rabo Development Partner Banks
Mobile Banking & Rabo Development Partner BanksMobile Banking & Rabo Development Partner Banks
Mobile Banking & Rabo Development Partner Banks
 
Mobile Convention Amsterdam - 22 May 2013
Mobile Convention Amsterdam - 22 May 2013Mobile Convention Amsterdam - 22 May 2013
Mobile Convention Amsterdam - 22 May 2013
 
Future of Web 2.0 - talk, 22 September 2009
Future of Web 2.0 - talk, 22 September 2009Future of Web 2.0 - talk, 22 September 2009
Future of Web 2.0 - talk, 22 September 2009
 
Rabo Development Retail Distribution & Channel Strategies & Successes
Rabo Development Retail Distribution & Channel Strategies & Successes Rabo Development Retail Distribution & Channel Strategies & Successes
Rabo Development Retail Distribution & Channel Strategies & Successes
 
Banking Distribution Overview
Banking Distribution OverviewBanking Distribution Overview
Banking Distribution Overview
 
M-Commerce World Summit 2011 - Introduction
M-Commerce World Summit 2011 - IntroductionM-Commerce World Summit 2011 - Introduction
M-Commerce World Summit 2011 - Introduction
 
Rabo Mobiel & NMB Mobile: Mobile Banking & Payments Development
Rabo Mobiel & NMB Mobile: Mobile Banking & Payments DevelopmentRabo Mobiel & NMB Mobile: Mobile Banking & Payments Development
Rabo Mobiel & NMB Mobile: Mobile Banking & Payments Development
 
techMAP Amsterdam: What's trending in 2012? A focus on SOLOMO
techMAP Amsterdam: What's trending in 2012? A focus on SOLOMOtechMAP Amsterdam: What's trending in 2012? A focus on SOLOMO
techMAP Amsterdam: What's trending in 2012? A focus on SOLOMO
 
The Consumer Side of NFC and Mobile Payments
The Consumer Side of NFC and Mobile PaymentsThe Consumer Side of NFC and Mobile Payments
The Consumer Side of NFC and Mobile Payments
 
Mobey Forum - Case Study: Banking the Banked with NMB Mobile
Mobey Forum - Case Study: Banking the Banked with NMB MobileMobey Forum - Case Study: Banking the Banked with NMB Mobile
Mobey Forum - Case Study: Banking the Banked with NMB Mobile
 
Mobile Banking & Payments Update: September 2010
Mobile Banking & Payments Update: September 2010Mobile Banking & Payments Update: September 2010
Mobile Banking & Payments Update: September 2010
 
BPR Mobile Banking
BPR Mobile BankingBPR Mobile Banking
BPR Mobile Banking
 
Rabo Development & Sustainable Distribution
Rabo Development & Sustainable DistributionRabo Development & Sustainable Distribution
Rabo Development & Sustainable Distribution
 
Rabo Development Retail Distribution Case Study: Mobile Banking and Payments
Rabo Development Retail Distribution Case Study: Mobile Banking and PaymentsRabo Development Retail Distribution Case Study: Mobile Banking and Payments
Rabo Development Retail Distribution Case Study: Mobile Banking and Payments
 
Africa - Mobile Convention Amsterdam
Africa - Mobile Convention AmsterdamAfrica - Mobile Convention Amsterdam
Africa - Mobile Convention Amsterdam
 
Mobile Payments & Banking - NACHA Global Payments Forum
Mobile Payments & Banking - NACHA Global Payments ForumMobile Payments & Banking - NACHA Global Payments Forum
Mobile Payments & Banking - NACHA Global Payments Forum
 

Similar to JSONModel Lightning Talk

Battle of The Mocking Frameworks
Battle of The Mocking FrameworksBattle of The Mocking Frameworks
Battle of The Mocking FrameworksDror Helper
 
GCSECS-DefensiveDesign.pptx
GCSECS-DefensiveDesign.pptxGCSECS-DefensiveDesign.pptx
GCSECS-DefensiveDesign.pptxazida3
 
Dutch PHP Conference 2015 - The quest for global design principles
Dutch PHP Conference 2015 - The quest for global design principlesDutch PHP Conference 2015 - The quest for global design principles
Dutch PHP Conference 2015 - The quest for global design principlesMatthias Noback
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.WO Community
 
Generative Testing in Clojure
Generative Testing in ClojureGenerative Testing in Clojure
Generative Testing in ClojureAlistair Roche
 
2011 - SharePoint + jQuery
2011 - SharePoint + jQuery2011 - SharePoint + jQuery
2011 - SharePoint + jQueryChris O'Connor
 
Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!Garth Gilmour
 
Jest: Frontend Testing richtig gemacht @WebworkerNRW
Jest: Frontend Testing richtig gemacht @WebworkerNRWJest: Frontend Testing richtig gemacht @WebworkerNRW
Jest: Frontend Testing richtig gemacht @WebworkerNRWHolger Grosse-Plankermann
 
Core Data in RubyMotion #inspect
Core Data in RubyMotion #inspectCore Data in RubyMotion #inspect
Core Data in RubyMotion #inspectLori Olson
 
Managing and evolving JavaScript Code
Managing and evolving JavaScript CodeManaging and evolving JavaScript Code
Managing and evolving JavaScript CodeJean Carlo Emer
 
Test Driven Development - Workshop
Test Driven Development - WorkshopTest Driven Development - Workshop
Test Driven Development - WorkshopAnjana Somathilake
 
SQL Server 2016 JSON
SQL Server 2016 JSONSQL Server 2016 JSON
SQL Server 2016 JSONDavide Mauri
 
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Edward Burns
 
How to build a SaaS solution in 60 days
How to build a SaaS solution in 60 daysHow to build a SaaS solution in 60 days
How to build a SaaS solution in 60 daysBrett McLain
 
Breaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDB
Breaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDBBreaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDB
Breaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDBMongoDB
 
Writing enterprise software error checking
Writing enterprise software error checkingWriting enterprise software error checking
Writing enterprise software error checkingRiversand Technologies
 
Using MLOps to Bring ML to Production/The Promise of MLOps
Using MLOps to Bring ML to Production/The Promise of MLOpsUsing MLOps to Bring ML to Production/The Promise of MLOps
Using MLOps to Bring ML to Production/The Promise of MLOpsWeaveworks
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDavide Mauri
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)Jia Mi
 
Mariia Havrylovych "Active learning and weak supervision in NLP projects"
Mariia Havrylovych "Active learning and weak supervision in NLP projects"Mariia Havrylovych "Active learning and weak supervision in NLP projects"
Mariia Havrylovych "Active learning and weak supervision in NLP projects"Fwdays
 

Similar to JSONModel Lightning Talk (20)

Battle of The Mocking Frameworks
Battle of The Mocking FrameworksBattle of The Mocking Frameworks
Battle of The Mocking Frameworks
 
GCSECS-DefensiveDesign.pptx
GCSECS-DefensiveDesign.pptxGCSECS-DefensiveDesign.pptx
GCSECS-DefensiveDesign.pptx
 
Dutch PHP Conference 2015 - The quest for global design principles
Dutch PHP Conference 2015 - The quest for global design principlesDutch PHP Conference 2015 - The quest for global design principles
Dutch PHP Conference 2015 - The quest for global design principles
 
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
Beyond Fluffy Bunny. How I leveraged WebObjects in my lean startup.
 
Generative Testing in Clojure
Generative Testing in ClojureGenerative Testing in Clojure
Generative Testing in Clojure
 
2011 - SharePoint + jQuery
2011 - SharePoint + jQuery2011 - SharePoint + jQuery
2011 - SharePoint + jQuery
 
Down With JavaScript!
Down With JavaScript!Down With JavaScript!
Down With JavaScript!
 
Jest: Frontend Testing richtig gemacht @WebworkerNRW
Jest: Frontend Testing richtig gemacht @WebworkerNRWJest: Frontend Testing richtig gemacht @WebworkerNRW
Jest: Frontend Testing richtig gemacht @WebworkerNRW
 
Core Data in RubyMotion #inspect
Core Data in RubyMotion #inspectCore Data in RubyMotion #inspect
Core Data in RubyMotion #inspect
 
Managing and evolving JavaScript Code
Managing and evolving JavaScript CodeManaging and evolving JavaScript Code
Managing and evolving JavaScript Code
 
Test Driven Development - Workshop
Test Driven Development - WorkshopTest Driven Development - Workshop
Test Driven Development - Workshop
 
SQL Server 2016 JSON
SQL Server 2016 JSONSQL Server 2016 JSON
SQL Server 2016 JSON
 
Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015Java EE 7 from an HTML5 Perspective, JavaLand 2015
Java EE 7 from an HTML5 Perspective, JavaLand 2015
 
How to build a SaaS solution in 60 days
How to build a SaaS solution in 60 daysHow to build a SaaS solution in 60 days
How to build a SaaS solution in 60 days
 
Breaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDB
Breaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDBBreaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDB
Breaking the Oracle Tie; High Performance OLTP and Analytics Using MongoDB
 
Writing enterprise software error checking
Writing enterprise software error checkingWriting enterprise software error checking
Writing enterprise software error checking
 
Using MLOps to Bring ML to Production/The Promise of MLOps
Using MLOps to Bring ML to Production/The Promise of MLOpsUsing MLOps to Bring ML to Production/The Promise of MLOps
Using MLOps to Bring ML to Production/The Promise of MLOps
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your life
 
John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)John Resig Beijing 2010 (English Version)
John Resig Beijing 2010 (English Version)
 
Mariia Havrylovych "Active learning and weak supervision in NLP projects"
Mariia Havrylovych "Active learning and weak supervision in NLP projects"Mariia Havrylovych "Active learning and weak supervision in NLP projects"
Mariia Havrylovych "Active learning and weak supervision in NLP projects"
 

Recently uploaded

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamUiPathCommunity
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxRemote DBA Services
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...apidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
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 WoodJuan lago vázquez
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
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 FMESafe Software
 

Recently uploaded (20)

Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
+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...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.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
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
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
 

JSONModel Lightning Talk

  • 1. Blah blah Blah blah Blah blah Blah blah !!!!#$! App Store 2008: -connected apps, showing real time data! Whoa Nelly! - in your pocket! Boom!
  • 2. Communication OK? XML? CSV? binary? <myverylongtagname> 1 </myverylongtagname> MyName, 1, 2, 5, left, TRUE Other, 5, 4, 3, left, FALSE 0100001001100101001000 0001110011011101010111 0010011001010010000001 110100011011110 JSON
  • 3. JSON is awesome 1) it’s very SIMPLE! 2) supported by tons of languages 3) structural data
  • 4. • Step1: Stackoverflow • Step2: click the link in approved answer • Step3: • How to JSON?
  • 5. Simplest approach [[[[[json objectForKey:@”name”] objectAtIndex:1] objectAtIndex: 2] objectForKey:@”value”] boolValue] 2009 code 2013 code [json[@”name”][1][2][@”value”] boolValue]
  • 6. never! - json ... is nil ... - EXC_BAD_ACCESS - ... unrecognized selector ... [NSString boolValue] - ... index out of bounds ...
  • 7. Pros & Cons • very quick code turnaround!!! • no structure validation • no data validation • difficult to error handle • it’s the road to maintenance HELL! evolution indicator
  • 8. A better way! NSDictionary* json = [NSJSONSerialization ... ]; if (json == nil) [self errorHandleEmptyJSON]; if (json[@”name”] == nil) [self errorHandleEmptyName]; NSArray* name = json[@”name”]; if (name.count<1] [self errorHandleWrongJSONStructure]; NSNumber* value = name[1][2][@”value”];
  • 9. Forget much? oh noes... Looks good so far, what’s left? - validate the data for all values you use - check if the incoming objects are of the expected class type (yuicks!) - make sure you decend into the JSON according to the incoming structure
  • 10. Pros & cons? • Horribly slow to write code • Difficult to maintain • How do you recover from errors in the middle of the parsing process??? • Better data validation • Better structure validation evolution indicator
  • 11. Data models? The “M” in MVC stands for “MODEL” Wrap up all the code in classes for all your models
  • 12. feels good! Your models feature custom init which reads the JSON and builds up the model representation All IF statements and all the error handling is handled within the model class Other magic you coded at 4.17am on a Thursday
  • 13. Pros & cons • Using a class instead of NSDictionary • OOP 4 Ever! • Very flexible code • Lot of redundant parsing code • Lot of implementation • Still harder to adapt to changes evolution indicator
  • 14. Then what? Throughout 2012 I worked mainly on JSON powered applications. In December I was already fed-up with: self.name = json[@”name”]; Eureka!
  • 15. JSONModel - import JSON - structure validation - data type validation - data type conversion - atomic operations - error handling Automatically does/has:
  • 16. Import JSON .h .m For relatively simple models eliminates the need to code in your .m file
  • 17. Validation @property (strong, nonatomic) NSString* name; What you want is: What you should be getting might be: {“name”:“Name”} It is about what you want to have!
  • 18. Conversion @property (strong, nonatomic) NSURL* blogSiteUrl; What you want is: What you get is: {“blogSiteUrl”:“http://www.yahoo.com”} It is about what you want to have!
  • 19. JSONModel evolution indicator Takes the hum-drum out of coding It’s very fast Growing (testing) fan base