4. モダンアプリケーション・デザイン:階層属性
4
Application-specific
Backend
Other Cloud Services
On-prem Services
End Users
User-facing Client Apps
Role: User Interactions &
Remote Sensing
Application State: User
& View Specific State,
Caching of eventually
consistent state
Usage: Sometimes on,
Driven by Users and
Events
Resources: Constrained
CPU, Mem, Network BW
Role: Integration
Service Composition,
Background Monitoring/Activity,
Event/Traffic Routing,
State synchronization across
clients and things
Application State: Global
Application State
Usage: Always-on, Always
Connected
Resources: Unlimited CPU,
Mem, Network BW
8. IBM Swift Sandbox
8
The IBM Swift Sandbox
Swiftをサーバーで書いて
仲間とシェア
特徴
• Swift on Linux に⼀撃
アクセス
• モバイル利⽤・オートセ
ーブ機能
• コードスナップショット
• ソーシャルシェアリング
https://swift.sandbox.bluemix.net
16. 開発の流れ
16
Kitura.addHTTPServer(port: 8090, with: router)
Kitura.run()
let router = Router()
router.get("/hello") { request, response, next in
response.status(.OK).send("<h1>Hello, World!</h1>")
next()
}
7. Create and start a HTTPServer:
5. router と pathを記述
router.get("/hello.json") { request, response, next in
response.status(.OK).send(json: JSON(["Hello": "World!"]))
next()
}
6. JSON data routeを記述
17. 開発の流れ
17
import Kitura
import SwiftyJSON
let router = Router()
router.get("/hello") { request, response, next in
response.status(.OK).send("<h1>Hello, World!</h1>")
next()
}
router.get("/hello.json") { request, response, next in
response.status(.OK).send(json: JSON(["Hello": "World!"]))
next()
}
Kitura.addHTTPServer(port: 8090, with: router)
Kitura.run()
8. Sources/main.swiftは以下の通り
18. 開発の流れ
18
Mac OS X: swift build
Linux: swift build -Xcc –fblocks
9. Compile your application:
.build/debug/myFirstProject
10. Run your web application:
11. Open your browser:
http://localhost:8090/hellohttp://localhost:8090/ http://localhost:8090/hello.json
24. デベロッパーエクスペリエンス
24
Xcode Developer
Experience
Swift on the client
Build and
Debug
Applications
IBM Swift Sandbox
Collaborative Code as
Questions/Answers
Provision 3rd Party Client-side
Registered Swift Packages
IBM Cloud Services
Provision IBM Cloud
Service Packages and
Credentials
Swift
Packages
Swift on the server
Docker
Whisk
CloudFoundry
Sandbox