Skip to content

FAQ: SNA

dsriseah edited this page Dec 11, 2024 · 2 revisions

SNA FAQ

Q. How is SNA different from URSYS?

URSYS is a set of build tools and utility modules for accessing files, establishing servers and networking between client webapps, and other reusable concepts that are common for learning sciences applications. You use URSYS to create new application structures from scratch.

By comparison, SNA is an opionated set of application structures that builds on top of URSYS. For example, URSYS does not define a directory structure or mandate the use of lifecycle-driven application design. SNA does. This makes it simpler to start an SNA-based application than writing one from scratch using plain URSYS, while still benefiting from all the available features if you need them.

Q. What are the main advantages of an SNA application?

  1. SNA supports dynamic importing of web and server modules without having to use import as a dependency.
  2. SNA coordinates order-sensitive operations through prefined lifecycles through PhaseMachine, which improves separation of concerns when writing a self-contained "feature" module.
  3. SNA provides a defined directory structure, which you pass as a path to SNA_Build( path ) and the entire server+app+messaging system starts without additional configuration.
  4. SNA provides hot module reloading on change to assets in the server, client, or assets folder.
  5. SNA defines a chained module initialization mechanism through its SNA_Component definition, helping avoid circular dependencies.
  6. SNA defines a standard module-level pub/sub interface through EventMachine as well as normal export.

Additionally, SNA leverages existing URSYS capabilities

  1. The code base is written in TypeScript and source is accessible from within the hosting URSYS monorepo.
  2. URNET is the "declare it and it works" message-based communications protocol for easy asyncronounous communication between peers and server
  3. DATASET provides data services over URNET with automatic synchronization.