UNPKG

2.04 kBJavaScriptView Raw
1/*
2 * Licensed under the Apache License, Version 2.0 (the "License");
3 * you may not use this file except in compliance with the License.
4 * You may obtain a copy of the License at
5 *
6 * http://www.apache.org/licenses/LICENSE-2.0
7 *
8 * Unless required by applicable law or agreed to in writing, software
9 * distributed under the License is distributed on an "AS IS" BASIS,
10 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 * See the License for the specific language governing permissions and
12 * limitations under the License.
13 */
14
15
16'use strict';
17
18const Typed = require('./typed');
19
20/**
21 * Resource is an instance that has a type. The type of the resource
22 * specifies a set of properites (which themselves have types).
23 *
24 *
25 * Type information in Concerto is used to validate the structure of
26 * Resource instances and for serialization.
27 *
28 *
29 * Resources are used in Concerto to represent Assets, Participants, Transactions and
30 * other domain classes that can be serialized for long-term persistent storage.
31 *
32 * @extends Typed
33 * @see See {@link Resource}
34 * @class
35 * @memberof module:concerto-core
36 */
37class Concept extends Typed {
38 /**
39 * This constructor should not be called directly.
40 * <p>
41 * <strong>Note: Only to be called by framework code. Applications should
42 * retrieve instances from {@link Factory}</strong>
43 * </p>
44 *
45 * @param {ModelManager} modelManager - The ModelManager for this instance
46 * @param {ClassDeclaration} classDeclaration - The class declaration for this instance.
47 * @param {string} ns - The namespace this instance.
48 * @param {string} type - The type this instance.
49 * @private
50 */
51 constructor(modelManager, classDeclaration, ns, type) {
52 super(modelManager, classDeclaration, ns, type);
53 }
54
55
56 /**
57 * Determine if this typed is a concept.
58 * @return {boolean} True if this typed is a concept,
59 * false if not.
60 */
61 isConcept() {
62 return true;
63 }
64}
65
66module.exports = Concept;