linkedin mobile search iphone architecture
DESCRIPTION
This is a high level presentation of the LinkedIn mobile search page.TRANSCRIPT
![Page 1: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/1.jpg)
LinkedIn Mobile Search iPhone Architecture
Dennis Byrne
![Page 2: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/2.jpg)
Agenda
● Model View Controller Pattern● Retrieval
o Core Datao Typeaheado Federated Search
● Cell construction & the Builder pattern● Metrics● Full Screen Scrolling● Unit Testing
![Page 3: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/3.jpg)
The Model - “if you can’t see it”
● Think nouns, not verbs● LISearchV3Model.m
o SearchData.mo NSArrayo NSDictionary
● Ridiculously Good Looking
![Page 4: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/4.jpg)
The View - “if you can see it”
● LISearchV3ViewController.xib● LISearchT1Cell.xib● LISearchT1CellHigh.xib● LISearchT1CellUltraHigh.xib● LISearchT2Cell.xib● LISearchT2CellHigh.xib● LISearchV2FilterButton.xib
![Page 5: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/5.jpg)
The Controller● LISearchV3ViewController.m● Think verbs, not nouns● Delegate Pattern● Event Listeners● Glue code● Logic
![Page 6: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/6.jpg)
MVC … try to think of it as VCM
10100101001010100101010010100101001110111111010100110100101001010100101010010100
TM
![Page 7: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/7.jpg)
![Page 8: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/8.jpg)
Agenda
● Model View Controller Pattern● Retrieval
o Core Datao Typeaheado Federated Search
● Cell construction & the Builder pattern● Metrics● Full Screen Scrolling● Unit Testing
![Page 9: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/9.jpg)
Retrieval Data Sources● Local Cache
o Core Datao SQLite
● Typeaheado phone-feo Typeahead Restli server
● Federated Searcho phone-feo Federated Search Restli server
![Page 10: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/10.jpg)
Retrieval - Core Data
![Page 11: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/11.jpg)
Retrieval - Remote Results
?
?
![Page 12: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/12.jpg)
Retrieval - Threading Model
● Everything is on the main thread● Except …
o Core Data retrievalo Core Data callbackso HTTP requests
![Page 13: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/13.jpg)
Retrieval Controller
phone-fe
![Page 14: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/14.jpg)
Agenda
● Model View Controller Pattern● Retrieval
o Core Datao Typeaheado Federated Search
● Cell construction & the Builder pattern● Metrics● Full Screen Scrolling● Unit Testing
![Page 15: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/15.jpg)
Cell Construction - Builder Pattern
● LISearchV3UITableViewCellBuilder.m
![Page 16: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/16.jpg)
Cell Builder
Retrieval Controller
phone-fe
![Page 17: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/17.jpg)
Agenda
● Model View Controller Pattern● Retrieval
o Core Datao Typeaheado Federated Search
● Cell construction & the Builder pattern● Metrics● Full Screen Scrolling● Unit Testing
![Page 18: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/18.jpg)
Metrics● LISearchV3Metrics.m● Page Views & Actions● Performance
o Firsto Secondo Thirdo Platform
iPhone android touch web
![Page 19: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/19.jpg)
Cell Builder
Metrics LPTimer
Retrieval Controller
Perf
phone-fe
![Page 20: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/20.jpg)
Agenda
● Model View Controller Pattern● Retrieval
o Core Datao Typeaheado Federated Search
● Cell construction & the Builder pattern● Metrics● Full Screen Scrolling● Unit Testing
![Page 21: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/21.jpg)
Full Screen Scrolling
![Page 22: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/22.jpg)
Cell Builder
Full ScreenScrolling
Metrics LPTimer
Retrieval Controller
Perf
phone-fe
![Page 23: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/23.jpg)
Agenda
● Model View Controller Pattern● Retrieval
o Core Datao Typeaheado Federated Search
● Cell construction & the Builder pattern● Metrics● Full Screen Scrolling● Unit Testing
![Page 24: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/24.jpg)
Unit Testing
● SenTestCase● LISearchV3JobScheduler
o LISearchV3ProductionJobScheduler.mo LISearchV3TestJobScheduler.m
● OCMock
![Page 25: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/25.jpg)
SenTest … similar to JUnit < 4.0
-(void)setUp {}-(void)testSomething {
STAssertEquals(YES, NO, @"msg here");STAssertEqualsWithAccuracy(1.0, 1.2, 0.1, @””);STFail(@”msg here”);}
![Page 26: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/26.jpg)
Dependency Injection
// similar to an interface in Java@protocol LISearchV3JobScheduler <NSObject>
- (void)enqueueOnMainThread:(void(^)())block;
@end
![Page 27: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/27.jpg)
OCMock
#import "OCMock.h"
id op = [OCMockObject mockForClass:[LINetworkOperation class]];
NSDictionary *tag = @{@”key”: @”value”};
[(LINetworkOperation *)[[op stub] andReturnValue:OCMOCK_VALUE(tag)] tag];
![Page 28: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/28.jpg)
Cell Builder
Full ScreenScrolling
Metrics LPTimer
Retrieval Controller
Perf
phone-fe
Job Scheduler
![Page 29: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/29.jpg)
The Napkin Test
![Page 30: LinkedIn Mobile Search iPhone Architecture](https://reader035.vdocuments.us/reader035/viewer/2022081602/55625861d8b42aa02d8b5608/html5/thumbnails/30.jpg)
Agenda
● Model View Controller Pattern● Retrieval
o Core Datao Typeaheado Federated Search
● Cell construction & the Builder pattern● Metrics● Full Screen Scrolling● Unit Testing