SlideShare ist ein Scribd-Unternehmen logo
1 von 41
Downloaden Sie, um offline zu lesen
Building & Maintaining
a Family of Applications
   Code Reuse on a Platform that Supports
        One Binary per Application
Jessica Kahn
  Tapulous
Why is code reuse
  important?
14 apps – soon to be 17.
  Five client engineers.
 Two server engineers.
I Know What You’re
    Thinking…
“I don’t have 14 apps in
    the App Store.”
“My couple of apps
aren’t really like one
   another at all.”
Oh, so you don’t…

• Use categories or subclasses to extend
  classes like NSString, UIViewController, or
  UIWebView?
• Collect analytical data?
• Display advertisements?
• Use Facebook Connect or another
  third-party library?
Of course you do!
What’s the basic methodology you need to apply?
Use a framework…
Psych!
Embed a loadable
   bundle…
j/k!
Tap Tap Revenge 2 Born
by Emergency C-Section
 You can’t hide “a baby” inside of an application.
         We learned this the hard way.
Static library it is.
Drawbacks
• Code size contributed to each product
• No self-containment of resources
• Must update every app to take advantage
  of a new version of your library
• If you don’t have the source, you have to
  trust its source
Plusses


• Supported on the iPhone
The Basics
• Create a static library project
• Embed this project into your application
  project
• Include the library’s resources in your
  application’s Copy Resources phase
• Set up the proper dependencies and
  linkages
Demo
One Size Fits Most
What to do when apps require slightly different
       versions of your static libraries.
Why is this needed?
Cosmetic Reasons
Cosmetic Reasons
Different Feature Sets
Different Feature Sets
Modified Behavior
Modified Behavior
Tactics for Customization

• Look up values in the app’s plist(s) and/or
  strings file(s) at runtime
• Override library methods with app-
  supplied subclasses or categories
• Override library resources in the app
  project
• Compile the library in an app-
  specific way
Demo
Gotchas & Hints
• Remove the default version of a resource
  from your project, to be sure to override
  with an app-specific one.
• Add all_load in OTHER_LDFLAGS for
  your application target, to ensure static
  library categories are loaded and linked
  properly.
• Use Xcode project templates.
Demo
Source Control
Using Subversion to maintain a stable base for
   some projects, while developing on the
          bleeding edge for others.
• svn:externals let you place your application
  adjacent to all its dependencies, no matter
  where they really live in the repository

• Trunk is the oft-unstable bleeding edge
• Tags are untouchable
• Branches lie somewhere in between
Demo
Bonus Points!
Build and Unit Test Automation
Builds

• Script your own, or…
• Use a continuous integration package:
 • BuildBot, Cruise Control & Hudson
• Both require knowledge of xcodebuild
Unit Tests

• ocunit built into the OS X & iPhone
    developer tools, supported on the
    Simulator since SDK 2.2
•   http://developer.apple.com/tools/unittest.html

•   Combine with continuous integration
In Summary…
• Most developers with more than one
  project can do more to reuse their code

• Spending some time up front saves time in
  the long run; teach Xcode, svn, and other
  tools to do the heavy lifting for you

• Development, support, and maintenance
  costs lowered through “economies of
  scale” and bug compatibility
Q &A

Weitere ähnliche Inhalte

Andere mochten auch (11)

State of the Philippine Environment
State of the Philippine EnvironmentState of the Philippine Environment
State of the Philippine Environment
 
Environmental Treaties, Laws and Policies
Environmental Treaties, Laws and PoliciesEnvironmental Treaties, Laws and Policies
Environmental Treaties, Laws and Policies
 
Theories of gender_inequalities
Theories of gender_inequalitiesTheories of gender_inequalities
Theories of gender_inequalities
 
Community health problems
Community health problemsCommunity health problems
Community health problems
 
Introduction to Environmental Health
Introduction to Environmental HealthIntroduction to Environmental Health
Introduction to Environmental Health
 
06 professional ethics & code of ethics
06 professional ethics & code of ethics06 professional ethics & code of ethics
06 professional ethics & code of ethics
 
Ethical issues in organizational behavior
Ethical issues in organizational behaviorEthical issues in organizational behavior
Ethical issues in organizational behavior
 
Moral values and ethics.
Moral values and ethics.Moral values and ethics.
Moral values and ethics.
 
Concept of health and disease
Concept of health and diseaseConcept of health and disease
Concept of health and disease
 
The Six Components of Health
The Six Components of HealthThe Six Components of Health
The Six Components of Health
 
Concept of health and disease
Concept of health and diseaseConcept of health and disease
Concept of health and disease
 

Mehr von John Wilker

Mehr von John Wilker (20)

Cranking Floating Point Performance Up To 11
Cranking Floating Point Performance Up To 11Cranking Floating Point Performance Up To 11
Cranking Floating Point Performance Up To 11
 
Introtoduction to cocos2d
Introtoduction to  cocos2dIntrotoduction to  cocos2d
Introtoduction to cocos2d
 
Getting Started with OpenGL ES
Getting Started with OpenGL ESGetting Started with OpenGL ES
Getting Started with OpenGL ES
 
User Input in a multi-touch, accelerometer, location aware world.
User Input in a multi-touch, accelerometer, location aware world.User Input in a multi-touch, accelerometer, location aware world.
User Input in a multi-touch, accelerometer, location aware world.
 
Physics Solutions for Innovative Game Design
Physics Solutions for Innovative Game DesignPhysics Solutions for Innovative Game Design
Physics Solutions for Innovative Game Design
 
Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...Getting Oriented with MapKit: Everything you need to get started with the new...
Getting Oriented with MapKit: Everything you need to get started with the new...
 
Getting Started with iPhone Game Development
Getting Started with iPhone Game DevelopmentGetting Started with iPhone Game Development
Getting Started with iPhone Game Development
 
Internationalizing Your Apps
Internationalizing Your AppsInternationalizing Your Apps
Internationalizing Your Apps
 
Optimizing Data Caching for iPhone Application Responsiveness
Optimizing Data Caching for iPhone Application ResponsivenessOptimizing Data Caching for iPhone Application Responsiveness
Optimizing Data Caching for iPhone Application Responsiveness
 
I Phone On Rails
I Phone On RailsI Phone On Rails
I Phone On Rails
 
Integrating Push Notifications in your iPhone application with iLime
Integrating Push Notifications in your iPhone application with iLimeIntegrating Push Notifications in your iPhone application with iLime
Integrating Push Notifications in your iPhone application with iLime
 
Starting Core Animation
Starting Core AnimationStarting Core Animation
Starting Core Animation
 
P2P Multiplayer Gaming
P2P Multiplayer GamingP2P Multiplayer Gaming
P2P Multiplayer Gaming
 
Using Concurrency To Improve Responsiveness
Using Concurrency To Improve ResponsivenessUsing Concurrency To Improve Responsiveness
Using Concurrency To Improve Responsiveness
 
Leaving Interface Builder Behind
Leaving Interface Builder BehindLeaving Interface Builder Behind
Leaving Interface Builder Behind
 
Mobile WebKit Development and jQTouch
Mobile WebKit Development and jQTouchMobile WebKit Development and jQTouch
Mobile WebKit Development and jQTouch
 
Accelerometer and OpenGL
Accelerometer and OpenGLAccelerometer and OpenGL
Accelerometer and OpenGL
 
Deep Geek Diving into the iPhone OS and Framework
Deep Geek Diving into the iPhone OS and FrameworkDeep Geek Diving into the iPhone OS and Framework
Deep Geek Diving into the iPhone OS and Framework
 
NSNotificationCenter vs. AppDelegate
NSNotificationCenter vs. AppDelegateNSNotificationCenter vs. AppDelegate
NSNotificationCenter vs. AppDelegate
 
Using SQLite
Using SQLiteUsing SQLite
Using SQLite
 

Kürzlich hochgeladen

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
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
 

Kürzlich hochgeladen (20)

Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
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
 
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...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
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...
 
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)
 
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, ...
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
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
 
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
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
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
 
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
 
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
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

Building & Maintaining a Family of Applications

  • 1. Building & Maintaining a Family of Applications Code Reuse on a Platform that Supports One Binary per Application
  • 2. Jessica Kahn Tapulous
  • 3. Why is code reuse important?
  • 4.
  • 5. 14 apps – soon to be 17. Five client engineers. Two server engineers.
  • 6. I Know What You’re Thinking…
  • 7. “I don’t have 14 apps in the App Store.”
  • 8. “My couple of apps aren’t really like one another at all.”
  • 9. Oh, so you don’t… • Use categories or subclasses to extend classes like NSString, UIViewController, or UIWebView? • Collect analytical data? • Display advertisements? • Use Facebook Connect or another third-party library?
  • 10. Of course you do! What’s the basic methodology you need to apply?
  • 13. Embed a loadable bundle…
  • 14. j/k!
  • 15. Tap Tap Revenge 2 Born by Emergency C-Section You can’t hide “a baby” inside of an application. We learned this the hard way.
  • 17. Drawbacks • Code size contributed to each product • No self-containment of resources • Must update every app to take advantage of a new version of your library • If you don’t have the source, you have to trust its source
  • 19. The Basics • Create a static library project • Embed this project into your application project • Include the library’s resources in your application’s Copy Resources phase • Set up the proper dependencies and linkages
  • 20. Demo
  • 21. One Size Fits Most What to do when apps require slightly different versions of your static libraries.
  • 22. Why is this needed?
  • 29. Tactics for Customization • Look up values in the app’s plist(s) and/or strings file(s) at runtime • Override library methods with app- supplied subclasses or categories • Override library resources in the app project • Compile the library in an app- specific way
  • 30. Demo
  • 31. Gotchas & Hints • Remove the default version of a resource from your project, to be sure to override with an app-specific one. • Add all_load in OTHER_LDFLAGS for your application target, to ensure static library categories are loaded and linked properly. • Use Xcode project templates.
  • 32. Demo
  • 33. Source Control Using Subversion to maintain a stable base for some projects, while developing on the bleeding edge for others.
  • 34. • svn:externals let you place your application adjacent to all its dependencies, no matter where they really live in the repository • Trunk is the oft-unstable bleeding edge • Tags are untouchable • Branches lie somewhere in between
  • 35. Demo
  • 36. Bonus Points! Build and Unit Test Automation
  • 37. Builds • Script your own, or… • Use a continuous integration package: • BuildBot, Cruise Control & Hudson • Both require knowledge of xcodebuild
  • 38. Unit Tests • ocunit built into the OS X & iPhone developer tools, supported on the Simulator since SDK 2.2 • http://developer.apple.com/tools/unittest.html • Combine with continuous integration
  • 40. • Most developers with more than one project can do more to reuse their code • Spending some time up front saves time in the long run; teach Xcode, svn, and other tools to do the heavy lifting for you • Development, support, and maintenance costs lowered through “economies of scale” and bug compatibility
  • 41. Q &A