All first class APAM object (Specification, Implementation, Instance, including Composite type and Composite) can have any number of associated properties; a property being a tuple <String, Object>, the string is the name of the property (unique for an object), and the Object is the value. The properties are primarily intended for the constraints and preferences mentioned in the resolution. However, some properties are predefined and interpreted by APAM to enforce component protection. These attributes are the following.
- 1 Instances (and Composites)
- 2 Implementations (and Composite Types)
- 3 Composite Types
Instances (and Composites)
shared= true | false
"shared = "false"" indicates that the instance can be destination of zero or one wire; better say it cannot be shared by different clients. Attribute "shared" is "true" by default.
Implementations (and Composite Types)
instantiable = true | false
An implementation is instantiable if it is possible to create an instance (calling method “createInstance” of APAM API). Typically, implementations which are driving devices are not instantiable (instantiating the implementation does not create the device). Attribute "instantiable" is "true" by default.
The goal of composites (types as well as instances) is to control their content. In a typical component platform, composites are black boxes, and at run-time, applications do not share anything. In a typical service platform, everything is accessible and shared; there is no concept of composite or application.
In APAM, the goal is to allow application and component designers to set precisely the behavior of their composites in the range between and including the “pure component” and “pure service” strategies. Since APAM is developed on top of a service platform, by default the service platform strategy is used (everything is visible and shared). The composite behavior is defined on the composite type. First, the attributes “borrowImplementation” and “borrowInstance” defined in a composiute type "C" define which implementations and instances, pertaining to other composites, can be used by "C" and all its instances. Conversely, the value of attributes “localImplementation” and "friendImplementaiton" set on the implementations and the value of attributes “localInstance”, "friendInstance" and "appliInstance" associated to instances define what other composite can see and use from the composite content.
What composites can borrow from the platform. The "borrow" attributes.
These attribute indicated if the composite (type or instance) can borrow (use) the implementations or instances deployed and instantiated by other composites. Typically, third party composites that want to be independent from the other applications running in the platform should not borrow anything (setting the attribute to false).
borrowImplementation = Expression | true | false
The composite type can borrow any implementation that matches the "Expression" (LDAP predicate over the target implementation properties). "borrowImplementation = true" means that the composite type can use any available implementation, "borrowImplementation = false" means that implementations must be deployed. By default, "borrowImplementation = true".
borrowInstance = Expression | true | false
This attribute, defined in a composite type, controls the content its composite instances. The composites can borrow any instance that matches the "Expression" (LDAP predicate over the instance properties). "borrowInstance = true" means that the composite can use any available instance, "borrowInstance = false" means that all the composite instances must pertain to the composite.
What the composite lends to the platform.
By default, the implementations and instances created inside a composite can be used by any other component running in the same Apam machine. This can be regulated using the following attributes.
localImplementation = Expression | true | false friendImplementation = Expression | true | false
A Client Composite implementation CC can see an implementation I pertaining to a Composite implementation Provider CP if:
- I pertains to CC ( CC = CP) or
- CP lends I to its friends, and CP is a friend, or
- CP lends I to the whole platform.
CP is a friend of CC if a relationship "friend" is established from CC to CP. A composite implementation can define which implementations can be lent to other composite implementations using the attributes "localImplem" and "friendImplem". The value of these attributes is an expression. An implementation cannot be lent if it matches the "localImplem" expression; it can be lent to friend composites if it matches the "friendImplem" expression; it is lent to the whole platform by default. If it matches both expressions, it is supposed to be local.
localInstance = Expression | true | false friendInstance = Expression | true | false appliInstance = Expression | true | false
A client instance pertaining to a composite instance "cc" can see an instance "inst" pertaining to a composite "cp" if:
- inst pertains to cc (cc = cp) or
- cp lends inst to its friends, and cp is a friend, or
- cp lends inst to the application, and cc and cp pertain to the same application,
- cp lends inst to the whole platform.
"cp" is a friend of "cc" if a "friend" relationship is established from "cc" to "cp". An instance pertaining to a single composite instance, the instances in a platform are organized as a forest. An application is defined as a tree in that forest (i.e., a root composite instance). Therefore, "cc" and "cp" pertain to the same application if they pertain to the same instance tree. A composite can define which instances can be lent to other composite instances using the predefined attributes "localInstance", "friendInstance" and "appliInstance". The value of these attributes is an expression to be applied to instance properties. An instance cannot be lent if it matches the "localInstance" expression; it can be lent to friend composite instances if it matches the "friendInstance" expression; it can be lent to any composite of the same application if it matches the "appliInstance" expression; and finally it is lent to the whole platform if it matches none. If it matches more than one expression, the most restrictive one is assumed.
If none of these attributes is defined, we are in the typical service strategy in which everything is shared and usable by everyone, in which case composites are of little added value.
For composite types, indicating “borrowImplementation = “true”” means that the composite type is populated only by its own implementations (probably deployed from its own repositories see Dynamic deployment ); indicating , "localImplementation = “true”" means that these implementations are not visible by any other composite types. However, the same implementation can be deployed by another composite type.