Skip to main content

Scalable JavaScript Application Architecture

Went to Yahoo developer meetup last week. Nicholas Zakas was the speaker that talked about how to build a scalable javascript application. There are some key points I’d like to share.

First is the overall architecture diagram.




Nicholas mentioned loose coupling is important to make an application scalable.


A loosely coupled system is one in which each of its components has, or makes use of, little or no knowledge of the definitions of other separate components.
  • Only the base library knows which browser is being used. 
  • Only the application core knows which base library is being used 
  • Only the sandbox knows which application core is being used 
  • The modules know nothing except that the sandbox exists 
  • No part knows about the web application
The advantages of such system are
  • Multiple different applications can be created with the same framework. 
  • Each part can be tested separately. 
  • Replace any parts do not break the application. 

The following link is Nicholas’ full slides with some pseudocode
http://www.slideshare.net/nzakas/scalable-javascript-application-architecture-2012

Comments

Popular posts from this blog

Bose TV Speaker vs Sonos Beam

I have been searching a compact soundbar for my living room. The Bose TV Speaker (2020 model) and Sonos Beam (2018 model) are my final contenders.  Size and Build Bose 23.5 w x 2.2 h x 4.1 d. Sonos 25.6 w x 2.6 h x 4.0 d. Height is an important factor here considering lots of TVs have very low bottom clearance. For example, LG OLED is only 1.5 inches. Build quality on both soundbars is solid. I personally like the Bose better because it has metal grills instead of cloth on Sonos. Sound rtings.com's technical review is spot on. I'm not going to have an in-deep review here, but just to point out a few things I found that are important.  The sound profiles are very similar. Sonos has a little bit wider stage and able to fill the room with music better thanks to its extra side speakers. It's also more neutral sounding. Bose has a noticeable clearer dialogue. They both have a dialogue enhance feature, but I find the result is poor. For Bose, it makes the dialogue harsh and hurts

Userful xcodebuild command lines

I setup Jenkins jobs to build iOS project for QA and release. Here are some useful xcodebuild commands that I use. Tested with XCode 9. Create a xcarchive file xcodebuild -project ${APPNAME}.xcodeproj -scheme ${APPSCHEME} -configuration Release clean -archivePath "${WORKSPACE}/${APPNAME}.xcarchive" archive Create an IPA from xcarchive file with exportOptions. xcodebuild -exportArchive -archivePath "${APPNAME}.xcarchive" -exportPath "${WORKSPACE}" -exportOptionsPlist exportOptions.plist -allowProvisioningUpdates If the above command doesn't create an IPA, try putting xcrun in front. To generate an IPA with the correct certificate and provision profile, you must set them correctly in exportOptions.plist. See example below. Create an APP file for simulator xcodebuild -project ${APPNAME}.xcodeproj -scheme ${APPSCHEME} -configuration Debug -sdk iphonesimulator clean build Sample exportOptions.plist <?xml version="1.0" encoding=&

How to resign an IPA with new bundle Id, certificate and entitlements

Create an Entitlements.plist using Xcode Include the following keys values in the plist file.  application-identifier (String) -> 3Q83MXXZGH.com.company.appname get-task-allow (Boolean) -> NO Put the Entitlements.plist in the same folder of the app.ipa file Unpackage the app unzip app.ipa Delete current code signature rm -rf Payload/MyApp.app/_CodeSignature/ Open Payload/MyApp.app/Info.plist in Xcode and update the bundle ID(CFBundleIdentifier) Copy the new .mobileprovision file to Payload/MyApp.app/embedded.mobileprovision Run the codesign command codesign -f -s "iPhone Distribution: Company Certificate" --resource-rules Payload/MyApp.app/ResourceRules.plist --entitlements Entitlements.plist Payload/MyApp.app Repackage the app zip -qr app-resigned.ipa Payload/ Sample Entitlements.plist <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.c