From 4803eef90768a31cfe8f0ec8507bfae4446dfcb7 Mon Sep 17 00:00:00 2001 From: Victor Woeltjen Date: Tue, 4 Aug 2015 09:55:15 -0700 Subject: [PATCH] [Documentation] Add initial arch. docs Add initial architecture docs; remove docs folder from gitignore, as the generated docs (which should be ignored) have been moved to target/docs. MissionControl/vista#21. --- .gitignore | 3 -- docs/src/architecture/Framework.md | 73 ++++++++++++++++++++++++++++++ docs/src/architecture/Platform.md | 0 3 files changed, 73 insertions(+), 3 deletions(-) create mode 100644 docs/src/architecture/Framework.md create mode 100644 docs/src/architecture/Platform.md diff --git a/.gitignore b/.gitignore index 2863ec0cb7..d815ed2081 100644 --- a/.gitignore +++ b/.gitignore @@ -20,9 +20,6 @@ closed-lib # Node dependencies node_modules -# Build documentation -docs - # Protractor logs protractor/logs diff --git a/docs/src/architecture/Framework.md b/docs/src/architecture/Framework.md new file mode 100644 index 0000000000..76ea473789 --- /dev/null +++ b/docs/src/architecture/Framework.md @@ -0,0 +1,73 @@ +#Overview + +The framework layer's most basic responsibility is allowing individual +software components to communicate. The software components it recognizes +are: + +* _Extensions_: Individual units of functionality that can be added to + or removed from Open MCT Web. _Extension categories_ distinguish what + type of functionality is being added/removed. +* _Bundles_: A grouping of related extensions + (named after an analogous concept from [OSGi](http://www.osgi.org/)) + that may be added or removed as a group. + +The framework layer operates by taking a set of active bundles, and +exposing extensions to one another as-needed, using +[dependency injection](https://en.wikipedia.org/wiki/Dependency_injection). +Extensions are responsible for declaring their dependencies in a +manner which the framework layer can understand. + +```nomnoml +#direction: down +[Open MCT Web| + [Dependency injection framework]-->[Platform bundle #1] + [Dependency injection framework]-->[Platform bundle #2] + [Dependency injection framework]-->[Plugin bundle #1] + [Dependency injection framework]-->[Plugin bundle #2] + [Platform bundle #1|[Extensions]] + [Platform bundle #2|[Extensions]] + [Plugin bundle #1|[Extensions]] + [Plugin bundle #2|[Extensions]] + [Platform bundle #1]<->[Platform bundle #2] + [Plugin bundle #1]<->[Platform bundle #2] + [Plugin bundle #1]<->[Plugin bundle #2] +] +``` + +The "dependency injection framework" in this case is +[AngularJS](https://angularjs.org/). Open MCT Web's framework layer +is really just a thin wrapper over Angular that recognizes the +concepts of bundles and extensions (as declared in JSON files) and +registering extensions with Angular. It additionally acts as a +mediator between Angular and [RequireJS](http://requirejs.org/), +which is used to load JavaScript sources which implement +extensions. + +```nomnoml +[Framework layer| + [AngularJS]<-[Framework Component] + [RequireJS]<-[Framework Component] + [Framework Component]1o-*[Bundles] +] +``` + +It is worth noting that _no other components_ are "aware" of the +framework component directly; Angular and Require are _used by_ the +framework components, and extensions in various bundles will have +their dependencies satisfied by Angular as a consequence of registration +activities which were performed by the framework component. + + +## Application Initialization + +The framework component initializes an Open MCT Web application following +a simple sequence of steps. + +```nomnoml +[ Start]->[ Load bundles.json] +[Load bundles.json]->[ Load bundle.json files] +[Load bundle.json files]->[ Resolve implementations] +[Resolve implementations]->[ Register with Angular] +[Register with Angular]->[ Bootstrap application] +[Bootstrap application]->[ End] +``` diff --git a/docs/src/architecture/Platform.md b/docs/src/architecture/Platform.md new file mode 100644 index 0000000000..e69de29bb2