Skip to content
Ruben Taelman edited this page May 9, 2018 · 3 revisions

Goals

The main goal of this small vocabulary is for describing object-oriented components that can be used in a semantic dependency injection framework, such as Components.js.

Design

The main requirement was that it should be able to describe JavaScript classes, parameters and instantiated objects. We designed the vocabulary in such a way that it can also be used for other object-oriented programming languages.

For the naming of the concept, we made use of the terminology by Fowler on his well-known article on dependency injection.

Requirements:

  1. Describe modules (collections of classes)
  2. Describe classes
  3. Classes can inherit from each other, and be marked as abstract (not instantiatable directly)
  4. Describe instances
  5. Describe parameters
  6. Indicate if parameters are required
  7. Indicate default values of parameters
  8. Constructor arguments mapping from RDF to objects

As a dependency injection framework allows both instances and classes to be passed to parameters, we require a concept to refer to both. We do this by introducing a concept called Component.

Method

Due to its requirement by Components.js, this vocabulary was created in conjunction with the development of Components.js in the following phases:

  1. Support for creation and detection of modules (R1): oo:Module
  2. Support for creation and detection of classes (R2): oo:Class, oo:Component, oo:component
  3. Support for class inheritance (R3): oo:AbstractClass
  4. Support for parameters, with default values and requirements (R5, R6, R7): oo:Parameter, oo:parameter, oo:defaultValue, oo:required
  5. Support for object mapping (R8): oo:constructorArguments and the standalone Object-Mapping ontology
  6. Support for instantiation and instance detection (R4): oo:Instance

Practical example can be found at http://componentsjs.readthedocs.io/en/latest/configuration/components/general/

Clone this wiki locally