Presentation about Components.js, a semantic dependency injection framework, at The Web Conference 2018 (Developers Track).
https://github.com/LinkedSoftwareDependencies/Components.js
5. Hard-wiring: Instantiate programmatically
let myCar = new Porsche356B({
color: 'ruby red',
engine: new V8Engine(),
tireFrontLeft: new MichelinLTXMS2(),
tireFrontRight: new MichelinLTXMS2(),
tireBackLeft: new MichelinLTXMS2(),
tireBackRight: new MichelinLTXMS2(),
});
myCar.drive();
+ Easy
- Less flexible swapping of components
6. Dependency Injection to the rescue!
let myCar = new Porsche356B({
color: 'ruby red',
engine: new V8Engine(),
tireFrontLeft: new MichelinLTXMS2(),
tireFrontRight: new MichelinLTXMS2(),
tireBackLeft: new MichelinLTXMS2(),
tireBackRight: new MichelinLTXMS2(),
});
myCar.drive();
7. Soft-wiring with declarative instantiation
let myCar = Loader.load('myCar-config.json');
myCar.drive();
+ Flexible swapping of components
- Extra layer of complexity
10. Components.js Terminology
Collection of components (e.g., a software package)
Something that can be instantiated (e.g., a class)
An instantiated Component
Module
Component
Instance
16. Get your hands on Components.js
https://www.npmjs.com/package/componentsjs
https://github.com/LinkedSoftwareDependencies/Components.js
https://componentsjs.readthedocs.io/
17. Ruben Taelman - @rubensworks
imec - Ghent University
Components.js
A semantic dependency injection framework
20. Why semantic configuration files?
Unique identification of components and instances via URIs
Split up config files, combine over the Web
Config files are meaningful as they use standard vocabularies
All of the benefits of Linked Data
Any RDF-enabled application can work with these config files
Visualize the instance graph
Reasoners can check if parameter values are valid
Reasoners can generate a config file best suited for a given situation
SPARQL querying over your config file