-
Notifications
You must be signed in to change notification settings - Fork 1
Design
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.
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:
- Describe modules (collections of classes)
- Describe classes
- Classes can inherit from each other, and be marked as abstract (not instantiatable directly)
- Describe instances
- Describe parameters
- Indicate if parameters are required
- Indicate default values of parameters
- 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.
Due to its requirement by Components.js, this vocabulary was created in conjunction with the development of Components.js in the following phases:
- Support for creation and detection of modules (R1):
oo:Module
- Support for creation and detection of classes (R2):
oo:Class
,oo:Component
,oo:component
- Support for class inheritance (R3):
oo:AbstractClass
- Support for parameters, with default values and requirements (R5, R6, R7):
oo:Parameter
,oo:parameter
,oo:defaultValue
,oo:required
- Support for object mapping (R8):
oo:constructorArguments
and the standalone Object-Mapping ontology - Support for instantiation and instance detection (R4):
oo:Instance
Practical example can be found at http://componentsjs.readthedocs.io/en/latest/configuration/components/general/