- It's mainly responsible for
- creating and event based application state
- parsing and compiling application data
- Consumed by presentation layer
/src/
application/
: Contains all application related code.collections/
: Holds collection filesCommon/
: Contains common functionality that is shared in application layer...
: other classes are categorized using folders-by-feature structure
- 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.
- Compiled to
Application
domain 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.
- 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
- 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