Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Alloy - Introduction of Titanium MVC Framework

Alloy - Introduction of Titanium MVC Framework

Titanium Mobile "MokuMoku" Meetup #2 Lighting Talk (2012/10/31)

Dd17014e380450cfed5d55ff20fa3dfd?s=128

Ryutaro Miyashita

October 31, 2012
Tweet

Transcript

  1. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP "MMPZ "MMPZ Titanium MVC Framework Introduction of

  2. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP éĕđ éĕđ Ryutaro Miyashita  ryugoo_  ryutaro.miyashita

     imthinker.net 5JUBOJVN.PCJMFϢʔβʔձॻه
  3. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP ˇɬ ˇɬ

  4. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP Üĕćð Üĕćð JavaScript.call(Titanium API) Called “Titanium Classic”

  5. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP ÜĕÔĒ ÜĕÔĒ Alloy(JavaScript.call(Titanium API)) JavaScript.call(Titanium API) +

  6. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP ËĖÍ ËĖÍ ϩδοΫͱݟͨ໨ͱσʔλॲཧͷ ίʔυ͕ΰνϟΰνϟͯͯ͠ΠϠΠϠ ϕετϓϥΫςΟεͷܹ͍͠ҠΓมΘΓ 5JJODMVEFͩͬͨΓ$PNNPO+4ͩͬͨΓʜ+44 ͋Γ·͚ͨͬ͠ ͏;;ɻ

  7. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP "QQDFMFSBUPS 0”DJBM.7$ 'SBNFXPSL "QQDFMFSBUPS 0”DJBM.7$ 'SBNFXPSL ËĖÍ ËĖÍ

    ϩδοΫ $   JavaScript ݟͨ໨ 7   XML + TSS σʔλॲཧ .  Backbone.js େৎ෉"QQDFMFSBUPSͷ.7$ϑϨʔϜϫʔΫͩΑ
  8. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP ʔèԨŒŤ¦ ʔèԨŒŤ¦ ڞ௨ཁૉ·ͱΊͨΓ*%$MBTTׂΓ౰ͯͨΓ "Window": { backgroundColor: "#FFFFFF" }

    <Alloy> <Window> <Label id="a" /> </Window> </Alloy> ݟͨ໨͸9.-Ͱ
  9. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP ŬķłĮIJŲŇŬ¦Ũ¦ ŬķłĮIJŲŇŬ¦Ũ¦ ݟͨ໨͍ͬͨ͡ΓɺΠϕϯτॲཧ͠·͢ $.index.on("open", function (e) { $.a.title

    = "Window is open!"; }); τοϓϨϕϧ6* ˣ Πϕϯτϋϯυϥ ˣ *% ˢ
  10. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP ņ¦ľ͎ՓšņŪ ņ¦ľ͎ՓšņŪ σʔλϕʔεͱ͔1SPQFSUJFTͷ͓࢓ࣄ var app = Alloy.createModel("user"); app.set({

    username: "Foobar", password: "Hoge" }); app.get("username"); // -> Foobar app.save(); VTFSϞσϧΛΦʔϓϯ ˢ ˡϞσϧʹσʔλΛηοτ ˡอଘ
  11. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP "QQT%FNP "QQT%FNP վΊͯ(JU)VCͰίʔυΛެ։༧ఆͰ͢

  12. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP òÏ˶Ï òÏ˶Ï Titanium Studio 3.0 (for User)ɹ 

     ৽نϓϩδΣΫτͷςϯϓϨʔτ͔Β Node.js + npm (for ਓபPro)ɹ   TVEPOQNJOTUBMMHUJUBOJVN   TVEPOQNJOTUBMMHBMMPZ
  13. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP ͜Μͳײ͡

  14. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP ˶ÑĔ ˶ÑĔ ˕ TSS͕ͱͬͯ΋ศར(´∀ʆ) ˚ ͪΐͬͱ͚ͩ໘౗͍͘͞(´Дʆ) ʷ Backbone.jsͷ஌ࣝඞཁ(‘A`)

    ίʔσΟϯάϧʔϧͷ౷ҰԽͱ͍͏ϙΠϯτ΋ ݸਓͷײ૝Ͱ͢ɻޮՌΛอূ͢Δ΋ͷͰ͸͋Γ·ͤΜɻ
  15. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP íćēø íćēø औѻʹ͸׳Ε͕ඞཁͰ͢ ׳ΕΔͱͦͦ͜͜ΩϨΠͳߏ଄ʹͳΓ·͢ Adobe Flex Ϣʔβ͸औ͖ͬͭ΍͍͔͢΋ ࠓ·Ͱͷํ๏͕ඇਪનʹͳΔΘ͚Ͱ͸͋Γ·ͤΜ

    ͔ͩΒօͰਓபʹͳΖ͏ ৘ใڞ༗ϑΟʔυόοΫ
  16. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP ͰӰøòÜ ͰӰøòÜ (JU)VCͷ3FBENF͸ඞಡ ϦϙδτϦʹςετ΋͋ΔΑ IUUQTHJUIVCDPNBQQDFMFSBUPSBMMPZ 2VJDL4UBSU΋ඞಡ IUUQQSPKFDUTBQQDFMFSBUPSDPNBMMPZEPDT"MMPZCPPUTUSBQ #BDLCPOFKT΋

    #BDLCPOF&WFOU#BDLCPOF.PEFM IUUQCBDLCPOFKTPSH ެࣜυΩϡϝϯτΛ๨ΕͪΌ͍͚ͳ͍ IUUQEPDTBQQDFMFSBUPSDPNUJUBOJVNBQJ"MMPZ
  17. 5JUBOJVN4UVEZ.FFUJOH5PLZP 5JUBOJVN4UVEZ.FFUJOH5PLZP $0%&4530/( $0%&4530/(