Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

2018-06-27-example-driven-development.md 2.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. Title: Example-driven development
  2. Date: 2018-06-27 00:00
  3. Category: News
  4. Slug: example-driven-development
  5. Lang: en
  6. ![Debug broker][screenshot]
  7. This article explains how the third OpenSceneGraph cross-platform example opened our eyes to example-driven development.
  8. **2018-08 EDIT**: the third example has been renamed to the fourth one due to the reasons described in the [next article][article-2018-august].
  9. **The third OpenSceneGraph cross-platform example**
  10. The third OpenSceneGraph cross-platform example explains how to implement [remote debugging across platforms][osgcpe-04]. This example is less about OpenSceneGraph and more about different platforms.
  11. Remote anything nowadays assumes the use of HTTP(s) over TCP/IP. Thus, the first idea was to embed HTTP server into an application and let HTTP clients interact with the server.
  12. However, serving HTTP across all platforms is complicated:
  13. * desktops have firewalls
  14. * mobiles have restrictions on background processes
  15. * web browsers are HTTP clients by design
  16. That's why we decided to create a mediator between debugged application and UI. [Debug broker][debug-broker], a small Node.js application, became that mediator. Debug broker uses no external dependencies, so it's easy to run virtually anywhere. Also, since debug broker is a server application, you can configure it once and use it for any number of applications.
  17. Both [debug UI][debug-ui] and [debug broker][debug-broker] use JavaScript because we wanted these tools to be accessible from anywhere with no prior installation. This decision limited us to web browser solution. Providing any sort of desktop application would incur additional installation and maintenance effort, which would only complicate the tools.
  18. **Example-driven development establishment**
  19. Once the third example was implemented, we realized how important and beneficial it is to develop new features outside the main project:
  20. * the main project is freed from excessive commit noise
  21. * a new feature is publicly shared for everyone to learn, criticize, and improve
  22. When we publicly share our knowledge:
  23. * we must create documentation for everyone (including ourselves later) to understand what's going on
  24. * we must not use hacks because that would break your trust in us
  25. From now on, all new features like input handling, Mahjong layout loading, resource caching, etc. are going to be first implemented as examples. We call this example-driven development.
  26. That's it for explaining how the third OpenSceneGraph cross-platform example opened our eyes to example-driven development.
  27. [screenshot]: ../../images/2018-06-27-example-driven-development.png
  28. [article-2018-august]: examples-and-dependencies.html
  29. [osgcpe-04]: https://github.com/OGStudio/openscenegraph-cross-platform-examples/tree/master/04.RemoteDebugging
  30. [debug-broker]: https://github.com/OGStudio/debug-broker
  31. [debug-ui]: https://github.com/OGStudio/debug-ui