WP7 Apps+Azure
WP7 Apps+Azure
Sran Boovi
AGENDA
WP7 APP DESIGN
CLOUD INTERACTION
TECHNOLOGIES
ISSUES
WP7 APP DESIGN
LEVEL 0
LEVEL 1
LEVEL 2
CLOUD INTERACTION
ZATO CLOUD?
Savrena platforma za distribuciju sadraja
Skalabilnost
Plaanje prema potronji
CDN
Dodatni servisi
ACS
Traffic Manager
Keiranje
PRIKAZ INTERAKCIJA
Obrada
Notifikacija
Web API
JSON
TA SMO UPRAVO VIDELI ?
Skladitenje podataka
Sinhronizaciju
Servis u pozadini
Notifikacije
SKLADITENJE
SQL Azure
Relacione baza
Performantan
Odravan kao servis
Windows Azure Tables
Ne-relaciono struktuirano skladite
Veoma skalabilno skladite
OData
Windows Azure Blobs
Veliki fajlovi
Metapodaci
REST
SINHRONIZACIJA
1. WP7 alje servisu
informaciju o trenutnoj
verziji podataka
2. Servis uzima podatke iz
BlobStorage-a
3. Proverava da li je aktuelna
verzija novija od verzije na
WP7
4. Ako je novija alje podatke
(ukljuujui i verziju), ako ne
HTTP odgovor ima prazno
telo
Web
Role
SERVIS
Zasnovan na interakciji izmeu
Web i Worker rola
Web Rola ima IIS
Worker Rola nema
DLL sa Main() metodom
Obe role naslaeuju RoleEntryPoint klasu
SERVIS
1. Web rola stavlja
posao u Queue
2. Worker rola
uzima poruku iz
Queue-a
3. Worker rola alje
notifikacije
MPNS
Worker
Role
Web
Role
NOTIFIKACIJE
Push Notifications
Postoji samo jedna konekcija izmeu Microsoft Push
Notification Service-a
Bandwidth & battery friendly
Ne postoji garancija za isporuku
Tri vrste push notifikacija
Raw alje poruku aplikaciji
Toast alje poruku korisniku
Tile menja Tile, sliku, tekst ili broja
NOTIFIKACIJE
1. Telefon otvara kanal
2. Telefon alje URL
aplikaciji
3. Aplikacija alje
podatke na URL
4. Microsoft Push
Notification Service
alje notifikacije
telefonu
MPNS
Web
Role
(1) (2)
(3)
(4)
TECHNOLOGIES
MVVM PATTERN
Model View
Presentation
Model
(ViewModel)
DataBinding
MVVM PATTERN
Omoguava
Potpuno odvojen dizajn od koda
Lake testiranje
Komande
Mogu biti vezane kao i podaci
ICommand interface
Execute method
CanExecute method
CanExecuteChanged event
PRISM
http://compositewpf.codeplex.com/
DI framework
http://funq.codeplex.com/
this.Container.Register<ITwitterServiceClient>(
c => new TwitterServiceClient());
this.Container.Register<ITwitterStore>(
c => new TwitterStore());
this.Container.Register<ITwitterUpdateService>(
c => new TwitterUpdateService(
c.Resolve<ITwitterServiceClient>(),
c.Resolve<ITwitterStore>()));
ViewModelLocator
snippets
public class ViewModelLocator : IDisposable
{
public MainViewModel MainViewModel {
get {
return containerLocator
.Container
.Resolve<MainViewModel>(); }
}
...
}
DataContext=
"{Binding Source=
{StaticResource ViewModelLocator},
Path=MainViewModel
}"
The Reactive Extensions (Rx)
http://bit.ly/jzLpud
...is a library to compose asynchronous and event-based programs
using observable collections and LINQ-style query operators.
public IObservable<TwittBatch> GetNewTwitts(
string sinceId)
{
var uri = new Uri(...);
return
HttpClient
.RequestTo(uri)
.GetJson<TwitterResultDto>()
.Select(dto=> {
... });
}
The Reactive Extensions (Rx)
http://bit.ly/jzLpud
public static IObservable<T> GetJson<T>(this HttpWebRequest request)
{
request.Method = "GET";
request.Accept = "application/json";
return
Observable
.FromAsyncPattern<WebResponse>(
request.BeginGetResponse, request.EndGetResponse)()
.Select(
response => {
using (var rdr =
new StreamReader(response.GetResponseStream()))
{
var result = rdr.ReadToEnd();
return
JsonConvert.DeserializeObject<T>(result);
}});
}
SILVERLIGHT TOOLKIT
http://silverlight.codeplex.com/
AutoCompleteBox
ContextMenu
DatePicker
GestureService/GestureListener
ListPicker
LongListSelector
Page Transitions
PerformanceProgressBar
TiltEffect
TimePicker
ToggleSwitch
WrapPanel
POSETITE
p&p WP7 Dev. Guide @ http://bit.ly/iDO5mf
ISSUES
Neumoljivi Marketplace
EKAJUI MANGO
Ne postoji relaciono skladite podataka
Ne mogue je promeniti Tile sa telefona
No SQL Azure 4 Co-Admin
JEDNOSTAVNO JE KOMPLIKOVANO
Phone7.Fx.Preview @ http://bit.ly/jHSJWz
[email protected]
@zmajcekbojelila
Q&A
Session Evaluations
Tell us what you think