Successfully reported this slideshow.

To Protect & To Serve

1

Share

Loading in …3
×
1 of 38
1 of 38

More Related Content

Related Books

Free with a 14 day trial from Scribd

See all

Related Audiobooks

Free with a 14 day trial from Scribd

See all

To Protect & To Serve

  1. 1. To Protect & To Serve Jorge D. Ortiz-Fuentes @jdortiz
  2. 2. A Canonical Examples production #Swift3Arch
  3. 3. Agenda ★ Swift Backend ★ DIY ★ The Test App
  4. 4. Swift Backend
  5. 5. Disclaimer Not a backend developer
  6. 6. Then, Why?
  7. 7. – Gustavo Adolfo Bécquer “What is poetry? you ask, while fixing your blue pupil on mine. What is poetry! And you are asking me? Poetry... is you.”
  8. 8. And you are asking me? No Refactoring Compiler Segmentation Fault Migrations Moving target No examples No reflection&introspection Xcode
  9. 9. Always Look at the Bright Side of Life ★ Opportunity to learn ★ Linux ★ Backend ★ Swift Package Manager
  10. 10. Does it mean that…
  11. 11. NO
  12. 12. Not ready for production yet
  13. 13. Not ready for production yet Some Scenarios
  14. 14. Just an Experiment?
  15. 15. Kinda
  16. 16. Useful Scenarios ★ Training ★ Prototyping ★ Embedded devices ★ Private servers
  17. 17. Server Side Swift is an IDE Immature Development Environment
  18. 18. Swift Package Manager ★ Promising… but not finished ★ Not fully integrated with Xcode ★ May not find a way to satisfy the dependencies
  19. 19. I couldn’t make libdistpatch 😢
  20. 20. I couldn’t make LLDB work 😢😢😢 Illegal instruction (core dumped)
  21. 21. But there is hope https://swift.org/server-apis/ Saint Chris, Chapter 42 verse FF
  22. 22. DIY
  23. 23. The Tools ★ Emacs (https://emacsformacosx.com/) • Tramp (SSH) • Swift-mode (2.2) ★ iTerm + tmux ★ Google Chrome
  24. 24. Frameworks ★ Kitura ★ Perfect ★ Vapor ★ Zewo
  25. 25. Kitura ★ Comes with everything and the kitchen sink ★ Compiles flawlessly ★ Good documentation and tutorials ★ Failed to make libdispatch for the Raspberry Pi
  26. 26. Perfect ★ Also quite complete ★ Excellent documentation & tutorials ★ Doesn’t fully compile in Raspberry Pi 3: NetTCP.swift & NetTCPSSL.swift (solved) ★ Slack channel ★ Need more time for the Raspberry Pi
  27. 27. Vapor ★ Worked without problems ★ Abundant documentation and tutorials (vapor.university) ★ Less modular (HTTP server & router provided by Application class) for the Raspberry Pi
  28. 28. Zewo ★ More modular, from independent pieces ★ Uses libmill/co-routines ★ Failed at compiling OpenSSL (Int size) ★ Really helpful Slack channel (shares members with Swift-arm channel) ★ Nice todo app example ★ My choice for this experiment for the Raspberry Pi
  29. 29. The Pieces Server Middleware Controller PersistenceRouter Views
  30. 30. That Sounds Familiar!
  31. 31. Clean Architecture: iOS App Delegate View (VC) Presenter Interactor Entity Gateway Connector
  32. 32. The Pieces Server Middleware Controller PersistenceRouter Views Interactor
  33. 33. Clean Architecture
  34. 34. The Test App
  35. 35. Conclusions ★ Swift code in Raspberry Pi has some glitches ★ The domain logic can be in a package: • Fully tested • Independent of the rest ★ Use cases can be shared • No asynchrony • Some logic may be different ★ Worth the investment
  36. 36. Things I Would Like ★ JSON home page / JSONAPI ★ Better (Some) debugging ★ Better support for Raspberry Pi
  37. 37. Thank you!
  38. 38. @jdortiz #Swift3Arch

×