Sunday, August 28, 2011

DEV301 Going Mobile: Any System to any Mobile Device

Apologies that this post is fairly nonsensical. I've put my raw NZ TechEd 2011 notes up here for my reference. I'd like to think that I'll refine them over time, but that probably won't be the case.
Lessons from the front line:
- Only architects like the boring bits
- Developers always want to write their own...

Architecture:
Auth
Access Control
Queuing

Native Apps vs HTML5
- Native Apps provide the best brand experience
  They look better

Using HTML5 and JavaScript is becoming a viable options (Appcelerator and PhoneGap)

JavaScript
- Use libraries
- Use Tools - e.g. WebStorm from JetBrains.
- Douglas Crockford's pattern. ****

REST/SOAP

SOAP
- focus on verbs
- Client side proxies
- Hide the transport layer

REST
- Roy Fielding - The web works, so use it.
- Focus on the nouns - expose resources identified by URIs
- Clients talk to resources on the server by sending and receiving documents
- Use the transport layer explicitly (GET, POST, PUT, DELETE)
- Data returned from the server is full of hyperlinks.

REST works really well for mobile applications
- no need to generate client proxy objects
- Clients are very tolerant of server changes if you use REST.
- JSON and REST work really well together, and JSON works well on mobile devices.
- Everything seems to work out simpler with REST

Recommendations
- No URI construction on the client; follow the hyperlinks instead. Dependency on the namespace
- DO NOT define new verbs; use GET, PUT, POST, DELETE
- If you think you need a new verb, e.g. 'Login', or 'FindCustomers', see the previous rule. Instead ask "What is the noun?"
- Start from a document with a big list of hyperlinks - 'root document'

WCF and REST
- IIS and WCF
WCF REST Contrib library
.NET 4 WCF WebHttp Services
"Introducing WCF WebHttp Services in .NET 4"