Open Sourcing Isaac

LinkedIn Engineering Team
5 min readintermediate
--
View Original

Overview

The article discusses the open-source release of Isaac, an Objective-C library designed to parse JSON into models, significantly improving code quality and reducing crash rates in iOS applications. It outlines the challenges faced with type safety in JSON parsing and how Isaac automates model inflation, providing a more reliable and readable coding experience.

What You'll Learn

1

How to use Isaac to automatically inflate models from JSON

2

Why type safety is crucial in JSON parsing for iOS apps

3

How to convert model objects back into JSON using Isaac

4

When to implement deep copy functionality for model objects

Prerequisites & Requirements

  • Basic understanding of Objective-C and JSON parsing

Key Questions Answered

How does Isaac improve the quality of iOS app code?
Isaac enhances code quality by providing a type-safe way to parse JSON into models, automatically nullifying values that break the defined contract. This reduces crash rates and simplifies the code structure, allowing developers to focus on functionality rather than error handling.
What are the main functionalities of the Isaac library?
Isaac allows automatic inflation of models from JSON, conversion of models back into JSON, and deep copying of model objects without needing to implement NSCopying. These features streamline the development process and enhance code maintainability.
What problems did LinkedIn face before using Isaac?
Before Isaac, LinkedIn's iOS app code was not type-safe, leading to crashes when JSON values did not match expected types. This was compounded by frequent server releases that could introduce bugs, making it difficult to maintain stability in the app.
How does Isaac utilize Objective-C's runtime library?
Isaac leverages Objective-C's runtime library to inspect object properties and their types. This enables the library to recursively traverse JSON data and create model objects dynamically, simplifying the parsing process.

Key Statistics & Figures

Reduction in crash rates for iOS apps
Exact percentage not provided
The article states that using Isaac has vastly improved code quality and decreased crash rates.

Technologies & Tools

Programming Language
Objective-c
Used to develop the Isaac library for parsing JSON into models.
Data Format
JSON
The primary data format that Isaac parses into Objective-C models.

Key Actionable Insights

1
Implement Isaac in your iOS projects to enhance JSON parsing efficiency.
By using Isaac, developers can automate the model inflation process, reducing manual coding errors and improving overall code quality.
2
Utilize Isaac's deep copy functionality to manage object states effectively.
This feature allows developers to create independent copies of objects without the overhead of implementing NSCopying, streamlining the codebase and reducing maintenance efforts.
3
Adopt type-safe properties in your model objects to prevent runtime crashes.
By defining properties with specific types, developers can catch errors at compile time rather than at runtime, significantly improving application stability.

Common Pitfalls

1
Not implementing type-safe properties in model objects can lead to runtime crashes.
When developers rely on dynamic typing without enforcing property types, they risk encountering unexpected data types from JSON, which can cause crashes in the application.

Related Concepts

JSON Parsing
Model-view-controller (mvc)
Type Safety In Programming