2.4 KiB
2.4 KiB
Application
- It's mainly responsible for
- creating and event based application state
- parsing and compiling application data
Application state
- ApplicationContext.ts holds the CategoryCollectionState for each OS
- Uses state pattern
- Same instance is shared throughout the application to ensure consistent state
- 📖 See Application State | Presentation layer to read more about how the state should be managed by the presentation layer.
- 📖 See ApplicationContext.ts to start diving into the state code.
Application data
- Compiled to
Applicationdomain object. - The scripts are defined and controlled in different data files per OS
- Enables data-driven programming and easier contributions
- Application data is defined in collection files and
- 📖 See Application data | Presentation layer to read how the application data is read by the presentation layer.
- 📖 See collection files documentation to read more about how the data files are structured/defined and see collection yaml files to directly check the code.
Parsing
- Application data is parsed to domain object
Application.ts - Steps
- (Compile time) Load application data from collection yaml files using webpack loader
- (Runtime) Parse and compile application and make it available to presentation layer by
ApplicationFactory.ts
Compiling
- Parsing the application files includes compiling scripts using collection file defined functions
- To extend the syntax:
- Add a new parser under SyntaxParsers where you can look at other parsers to understand more.
- Register your in CompositeExpressionParser