• No results found

6 Intermediate Architecture Description Language

6.5 Language Profiles

An architecture modelled with the IAL comprises elements of the kernel and elements of profiles.

The kernel includes the core aspects of architectural descriptions in the terms of this thesis – components and interfaces. Profiles add further concerns to the architecture language. Such concerns include e.g. different types of connectors, component hierarchies, types of interfaces, or quality aspects.

Architecture models of the IAL may include inconsistent information. E.g. an architecture can include information about a deep component hierarchy, and at the same time include the information that the architecture is flat. The semantics of this model is based on the interpreter.

Interpreting a profile is optional within the boundaries of exclusions and requirements between profiles. Therefore in the example given above, an architecture can be interpreted as a deep component type hierarchy when an interpreter handles deep hierarchies. When the interpreter can only handle flat hierarchies, the profile for deep hierarchies can be ignored, and the profile for flat hierarchies can be used as the source of information. The architecture is now interpreted, and possibly changed with a view on a flat hierarchy of component types, without loosing the information about the actual hierarchy. Profiles are not always independent, but can require

6.5 Language Profiles

or exclude each other. E.g. when a profile declaring event-based connectors is interpreted, it might be require to also interpret event-based interfaces. When a component hierarchy is interpreted to be flat, it cannot at the same time be interpreted as deep.

Profiles can be categorized regarding their abstract concern. E.g. the profiles Flat Component Hierarchy, and Scoped Component Hierarchy both handle the abstract concern of the component hierarchy, or Time Resource Demand and Security Levels both handle software quality concerns.

Some categories are mandatory, meaning that at least one profile has to be used when an architecture is described. One kind of component type hierarchy must be chosen. Some categories contain only optional profiles. E.g. no software quality profile is necessary to be used.

Figure 6.6: An overview of profiles of the Intermediate Architecture Description Language and their interrelationships

Figure 6.6 shows the profiles of the IAL, and their interrelationships regarding their

inter-6 Intermediate Architecture Description Language

pretation. The rectangles are categories of profiles, which share an abstract concern. The rectangles with rounded corners represent profiles. Mandatory categories (which have a solid border in Figure 6.6) require at least one profile to be used. Arrows between profiles show whether the interpretation of a profile requires or excludes the interpretation of another profile.

An arrow with a dashed line defines that when the source of the arrow is interpreted, it is required that its target is also interpreted. An arrow with a solid line defines that when the source of the arrow is interpreted, it is excluded that its target is interpreted. The reasons for these requirements and exclusions is stated in the sections describing the corresponding profiles. The following sections describe and formalize the current profiles and categories in the Intermediate Architecture Description Language. An example for the application of each profile is given in Appendix C. Considering the objective of the language, in the future more profiles and categories can be added.

6.5.1 Interface Types

In the language kernel the interface definition is of an abstract nature. The following profiles describe different types of interfaces.

Operation Interfaces

The Operation Interfaces profile (see Figure 6.7) declares operations that can be invoked by their clients. Operations have parameters and return types. Operations and operation parameters are named. Operation interfaces are very common in software architectures, both in architecture implementation and architecture specification languages. Examples are Session Beans in Enterprise JavaBeans (EJB) [EJB13], where beans invoke each other’s operations, or the Palladio Component Model [BKR09], an architecture specification language, which has operations in interfaces as entities and behaviour specifications that declare operation invocations.

6.5 Language Profiles

The OperationInterface stereotype can be applied to an interface to give it the role of an operation interface. This profile requires the use of the Operation Call Connector profile (see Definition 96) for connecting the requirements and provisions of operation-based interfaces.

Figure 6.7: The Operation Interfaces profile of the IAL

Formalization Definition 82 gives a formal description of the profile.

Definition 82: Interface Type Operations Profile

The Interface Type Operations profile POperationInterf acesis defined as follows. Empty sets are not explicitly stated:

B := {MM etaKernel} Stereotypes := {sOpInt} Classes := {cOp, cOpP ar}

Attributes := {aOp_retT yp, aOp_name, aOpP ar_typ, aOpP ar_name} Ref erences := {rOpInt_op, rOp_par}

Containments := {rOpInt_op, rOp_par} The elements are named as follows:

name(sOpInt) = OperationInterface, name(cOp) = Operation,

name(cOpP ar) = OperationParameter, name(aOp_retT yp) = returnType,

name(aOp_name) = name, name(aOpP ar_typ) = type, name(aOpP ar_name) = name,

name(rOpInt_op) = operations,

6 Intermediate Architecture Description Language

name(rOp_par) = parameters The stereotypes extend the following classes:

OperationInterface−extends−−−−→ Interface The attributes and references are defined as follows:

Operation.returnType−−−−−−→ Datatype,isOf T ype Operation.name−−−−−−→ String,isOf T ype OperationParameter.type−−−−−−→ Datatype,isOf T ype OperationParameter.name−−−−−−→ String,isOf T ype OperationInterface.operations−−−−−−→ Operation,isOf T ype

Operation.parameters−−−−−−→ OperationParameterisOf T ype Event Interfaces

The Event Interfaces profile (see Figure 6.8) declare events and event parameters. Components that provide an based interface reacts on these events. Components requiring an event-based interface triggers these events. Events and their parameters are named. Event parameters are typed. Just like operation interfaces, event interfaces are common in software architectures, both in architecture implementation and architecture specification languages. Examples are Message-Driven Beans in EJB, where beans invoke each other’s operations, or the Palladio Component Model, an architecture specification language, which has operations in interfaces as entities and behaviour specifications that declare operation invocations.

The EventInterface stereotype can be applied to an interface to give it the role of an event-based interface. This profile requires the use of the Event Dispatcher Connector profile for connecting the requirements and provisions of event-based interfaces.

Figure 6.8: The Event Interfaces profile of the IAL

6.5 Language Profiles

Formalization Definition 83 gives a formal description of the profile.

Definition 83: Interface Type Events Profile

The Interface Type Events profile PEventInterf acesis defined as follows. Empty sets are not explicitly stated:

B := {MM etaKernel} Stereotypes := {sEvInt} Classes := {cEv, cEvP ar}

Attributes := {aEv_name, aEvP ar_name, aEvP ar_typ} Ref erences := {rEvInt_ev, rEv_par}

Containments := {rEvInt_ev, rEv_par} The elements are named as follows:

name(sEvInt) = EventInterface, name(cEv) = Event,

name(cEvP ar) = EventParameters, name(aEv_name) = name,

name(aEvP ar_name) = name, name(aEvP ar_typ) = type,

name(rEvInt_ev) = events, name(rEv_par) = parameters The stereotypes extend the following classes:

EventInterface−extends−−−−→ Interface The attributes and references are defined as follows:

Event.name−−−−−−→ String,isOf T ype EventParameters.name−−−−−−→ String,isOf T ype

EventParameters.type−−−−−−→ Datatype,isOf T ype EventInterface.events−−−−−−→ Event,isOf T ype

Event.parameters−−−−−−→ EventParametersisOf T ype

6.5.2 Interface Hierarchy

These profiles consider where interfaces are declared within the architecture. The interpretation of these profiles exclude each other, so that an interface hierarchy can only be interpreted as either shared interface hierarchy, or scoped interface hierarchy.

6 Intermediate Architecture Description Language

Shared Interface Hierarchy

In the Shared Interface Hierarchy profile (see Figure 6.9), all interfaces are declared within the same scope, so that there are no visibility constraints. Shared interface hierarchies are known e.g. from the Java Enterprise Edition, where no kind of component or interface hierarchy is defined. As an example for specification languages, the PCM uses a shared repository, where all interfaces of a system are stored.

The stereotype SharedInterfacesArchitecture can be applied to an architecture to signal that this hierarchy type is modelled. The kernel already declares the Interface class as a child of the Architecture class. Therefore no more information is necessary.

Figure 6.9: The Shared Interface Hierarchy profile of the IAL

Formalization Definition 84 gives a formal description of the profile.

Definition 84: Interface Hierarchy Shared Profile

The Interface Hierarchy Shared profile PSharedInterf aceHierarchyis defined as follows. Empty sets are not explicitly stated:

B := {MM etaKernel} Stereotypes := {sSharIntAr} The elements are named as follows:

name(sSharIntAr) = SharedInterfacesArchitecture The stereotypes extend the following classes:

SharedInterfacesArchitecture−extends−−−−→ Architecture

Scoped Interface Hierarchy

In the Scoped Interface Hierarchy profile (see Figure 6.10), each interface is declared within the scope of a component type or within the scope of the architecture. This means that the interface can only be required or provided by component types that are children of this component type declaration or architecture and – when there is a deeper hierarchy of component types – within deeper levels. The stereotype ScopedInterfacesArchitecture can be applied to an architecture to signal that this hierarchy type is modelled. Additionally, the stereotype ScopedInterfacesComponentType can be applied to a component type to add information about

6.5 Language Profiles

the scope of an interface. A ScopedInterfacesComponentType references interfaces that are declared within its component type’s scope. Scoped interface hierarchies are used primarily in architecture specification languages. E.g. in the UML [Obj15] components can declare interfaces as so-called packagedElements within their scope.

This profile requires the use of the Delegation Connector profile (see Definition 98), for forwarding provisions and requirements of interfaces to subcomponents. This profile excludes the Flat Component Hierarchy profile (see Definition 86). It declares interfaces in the scope of component types, and these interfaces can only be provided or required by component types declared within the same scoped. It would not be possible for a component type to provide or require a child interface of another component type in a flat component type hierarchy.

Figure 6.10: The Scoped Interface Hierarchy profile of the IAL

Formalization Definition 85 gives a formal description of the profile.

Definition 85: Interface Hierarchy Scoped Profile

The Interface Hierarchy Scoped profile PScopedInterf aceHierarchyis defined as follows. Empty sets are not explicitly stated:

B := {MM etaKernel}

Stereotypes := {sScIntCompT yp, sScIntAr} Ref erences := {rScIntCompT yp_chilInt, rScIntAr_systInt} The elements are named as follows:

name(sScIntCompT yp) = ScopedInterfacesComponentType, name(sScIntAr) = ScopedInterfacesArchitecture, name(rScIntCompT yp_chilInt) = childInterfaces,

name(rScIntAr_systInt) = systemInterfaces The stereotypes extend the following classes:

ScopedInterfacesComponentType−extends−−−−→ ComponentType, ScopedInterfacesArchitecture−extends−−−−→ Architecture

6 Intermediate Architecture Description Language

The attributes and references are defined as follows:

ScopedInterfacesComponentType.childInterfaces−−−−−−→ Interface,isOf T ype ScopedInterfacesArchitecture.systemInterfaces−−−−−−→ InterfaceisOf T ype 6.5.3 Component Hierarchy

These profiles consider the type of hierarchy for component types. The interpretation of these profiles exclude each other, so that a component hierarchy can only be interpreted as either flat, shared, or scoped.

Flat Component Hierarchy

In this profile (see Figure 6.11) component types and their instances are all located in the same scope. Flat component hierarchies are rather common in architecture implementation languages. Examples for such languages used broadly in practice are the JEE or OSGi [The14].

The stereotype HierarchicalArchitectureFlat can be applied to an architecture to denote a flat component hierarchy. This profile excludes the Scoped Interface Hierarchy profile (see Definition 85). The profile Scoped Interface Hierarchy declares interfaces in the scope of component types, and these interfaces can only be provided or required by component types declared within the same scope. It would not be possible for a component type to provide or require a child interface of another component type in a flat component type hierarchy.

Figure 6.11: The Flat Component Hierarchy profile of the IAL

Formalization Definition 86 gives a formal description of the profile.

Definition 86: Component Hierarchy Flat Profile

The Component Hierarchy Flat profile PF latComponentHierarchy is defined as follows. Empty sets are not explicitly stated:

B := {MM etaKernel} Stereotypes := {sHierArF l} The elements are named as follows:

name(sHierArF l) = HierarchicalArchitectureFlat

6.5 Language Profiles

The stereotypes extend the following classes:

HierarchicalArchitectureFlat−extends−−−−→ Architecture Scoped Component Hierarchy

The Scoped Component Hierarchy profile (see Figure 6.12) describes a hierarchical component type architecture. The architecture and each component type are a scope, under which com-ponent instances and other comcom-ponent types can be declared. Scoped comcom-ponent hierarchies are commonly provided in architecture specification languages. As an example, UML provides scoped component hierarchies.

The stereotype HierarchicalArchitectureScoped can be applied to an architecture to signal that a scoped component hierarchy is modelled. An architecture has at least one component type as system type. The stereotype HierarchicalComponentTypeScoped can be applied to component types. These component types can reference other component types as child types and instances of these types as child instances. System instances are component instances in the top level scope.

Figure 6.12: The Scoped Component Hierarchy profile of the IAL

Formalization Definition 87 gives a formal description of the profile.

Definition 87: Component Hierarchy Scoped Profile

The Component Hierarchy Scoped profile PScopedComponentHierarchy is defined as follows.

Empty sets are not explicitly stated:

B := {MM etaKernel}

Stereotypes := {sHierCompT ypSc, sHierArSc}

6 Intermediate Architecture Description Language

Ref erences := {rHierCompT ypSc_chilInst, rHierCompT ypSc_chilT yp, rHierArSc_systT yp, rHierArSc_systInst} The elements are named as follows:

name(sHierCompT ypSc) = HierarchicalComponentTypeScoped, name(sHierArSc) = HierarchicalArchitectureScoped, name(rHierCompT ypSc_chilInst) = childInstances,

name(rHierCompT ypSc_chilT yp) = childTypes, name(rHierArSc_systT yp) = systemTypes, name(rHierArSc_systInst) = systemInstances The stereotypes extend the following classes:

HierarchicalComponentTypeScoped−extends−−−−→ ComponentType, HierarchicalArchitectureScoped−extends−−−−→ Architecture The attributes and references are defined as follows:

HierarchicalComponentTypeScoped.childInstances−−−−−−→ ComponentInstance,isOf T ype HierarchicalComponentTypeScoped.childTypes−−−−−−→ ComponentType,isOf T ype

HierarchicalArchitectureScoped.systemTypes cardinality

−−−−−−−→ 1..∗,

HierarchicalArchitectureScoped.systemTypes−−−−−−→ ComponentType,isOf T ype HierarchicalArchitectureScoped.systemInstances−−−−−−→ ComponentInstanceisOf T ype Shared Context Component Hierarchy

In this profile (see Figure 6.13), component types are all declared within the same scope.

Component types in this profile can be composed by child component instances. When a parent component type is instantiated in the running system, its child instances are also created.

Therefore a hierarchy of component instances is modelled. The PCM is an example for an architecture specification language with a shared context component hierarchy.

The stereotype HierarchicalArchitectureSharedContext can be applied to an architecture to signal that a shared context component hierarchy is modelled. Such an architecture declares system instances, i.e. component instances that exist when the system is instantiated. The stereotype HierarchicalComponentTypeSharedContext can be applied to a component type.

Such a component type can reference component instances as child instances.

6.5 Language Profiles

Figure 6.13: The Shared Context Component Hierarchy profile of the IAL

Formalization Definition 88 gives a formal description of the profile.

Definition 88: Component Hierarchy Shared Profile

The Component Hierarchy Shared profile PSharedContextComponentHierarchy is defined as follows. Empty sets are not explicitly stated:

B := {MM etaKernel}

Stereotypes := {sHierArSharCont, sHierCompT ypSharCont}

Ref erences := {rHierArSharCont_systInst, rHierCompT ypSharCont_chilInst} The elements are named as follows:

name(sHierArSharCont) = HierarchicalArchitectureSharedContext, name(sHierCompT ypSharCont) = HierarchicalComponentTypeSharedContext, name(rHierArSharCont_systInst) = systemInstances,

name(rHierCompT ypSharCont_chilInst) = childInstances The stereotypes extend the following classes:

HierarchicalArchitectureSharedContext−extends−−−−→ Architecture, HierarchicalComponentTypeSharedContext−extends−−−−→ ComponentType The attributes and references are defined as follows:

HierarchicalArchitectureSharedContext.systemInstances−−−−−−→ ComponentInstance,isOf T ype HierarchicalComponentTypeSharedContext.childInstances−−−−−−→ ComponentInstanceisOf T ype

6 Intermediate Architecture Description Language

6.5.4 Component Instantiation

When a component-based software is executed, the component types are instantiated. I.e.

executable units are created that represent the modelled functionality at run time. How component types are instantiated varies. For some component types, a statically defined fix number of instances are created. For other component types the number of instances is dynamically chosen, e.g. one instance per user session or the number of instances is based on the load, so when the load increases new instances can be created to cover the load. The static representation of how component types are instantiated is modelled using the following profiles.

These profiles can be used simultaneously in an architecture, albeit it is not allowed to declare multiple of these stereotypes on the same component type.

Fixed Component Instantiation

In the Fixed Component Instantiation profile (see Figure 6.14), the amount of instances of a component type is declared statically in the model, and cannot change at run time. When the component type is instantiated that exact number of instances must be created. Declaring com-ponent instances explicitly seems to be more common in architecture specification languages, than in architecture implementation languages. E.g. in PCM or the UML, a fixed number of instances can be declared. In architecture implementation languages it is sometimes possible to declare singleton component types. These types are instantiated exactly once. This is a special case of a fixed number of component instances. Examples for this kind of instantiation are application scoped beans in CDI. Architecture languages that allow for declaring component instances explicitly seem to be more common To model a fixed component instantiation, the stereotype ComponentInstancesFixedType has to be applied to a component type.

Figure 6.14: The Fixed Component Instantiation profile of the IAL

Formalization Definition 89 gives a formal description of the profile.

Definition 89: Component Instantiation Fixed Profile

The Component Instantiation Fixed profile PF ixedComponentInstantiationis defined as follows.

Empty sets are not explicitly stated:

B := {MM etaKernel}

Stereotypes := {sCompInstF ixT yp} Ref erences := {rCompInstF ixT yp_inst}

6.5 Language Profiles

The elements are named as follows:

name(sCompInstF ixT yp) = ComponentInstancesFixedType, name(rCompInstF ixT yp_inst) = instances

The stereotypes extend the following classes:

ComponentInstancesFixedType−extends−−−−→ ComponentType The attributes and references are defined as follows:

ComponentInstancesFixedType.instances−−−−−−→ ComponentInstanceisOf T ype Per Session Component Instantiation

In the Per Session Component Instantiation profile (see Figure 6.15) a new component instance is created for each user session. Instantiations per user session is known from architecture implementation languages from the domain of information systems, where server-side user sessions are handled. JEE e.g. provides stateful session beans for this case. In architecture specification languages, this type of component instantiation is uncommon. To model this instantiation type, the stereotype ComponentInstancePerSessionType has to be applied to a component type.

Figure 6.15: The Per Session Component Instantiation profile of the IAL

Formalization Definition 90 gives a formal description of the profile.

Definition 90: Component Instantiation Persession Profile

The Component Instantiation Persession profile PP erSessionComponentInstantiation is defined as follows. Empty sets are not explicitly stated:

B := {MM etaKernel}

Stereotypes := {sCompInstP erSessionT yp} Ref erences := {rCompInstP erSessionT yp_inst} The elements are named as follows:

name(sCompInstP erSessionT yp) = ComponentInstancePerSessionType, name(rCompInstP erSessionT yp_inst) = instances

6 Intermediate Architecture Description Language

The stereotypes extend the following classes:

ComponentInstancePerSessionType−extends−−−−→ ComponentType The attributes and references are defined as follows:

ComponentInstancePerSessionType.instances−−−−−−→ ComponentInstanceisOf T ype Pooled Component Instantiation

The Pooled Component Instantiation profile (see Figure 6.16) can be used to model an instan-tiation behaviour, where a pool of instances should be available. This instaninstan-tiation type is often used in architecture implementation languages for creating access to components with a high performance. E.g. in EJB, stateless session beans can be used to create this behaviour.

To model such an instantiation behaviour, the stereotype ComponentInstancePooledType can be applied to a component type. The minimal and maximal number of instances can be given.

The referenced component instance is a representative of the pool elements at design time.

The algorithm to choose the number of instances is represented by the PoolingStrategy. Its implementation is subject to the execution runtime.

Figure 6.16: The Pooled Component Instantiation profile of the IAL

Formalization Definition 91 gives a formal description of the profile.

Definition 91: Component Instantiation Pooled Profile

The Component Instantiation Pooled profile PP ooledComponentInstantiation is defined as fol-lows. Empty sets are not explicitly stated:

B := {MM etaKernel}

Stereotypes := {sCompInstP oolT yp} Classes := {cP oolSt}

Attributes := {aCompInstP oolT yp_minimumInst, aCompInstP oolT yp_maxInst} Ref erences := {rCompInstP oolT yp_rep, rCompInstP oolT yp_st}

6.5 Language Profiles Containments := {rCompInstP oolT yp_st}

The elements are named as follows:

name(sCompInstP oolT yp) = ComponentInstancePooledType, name(cP oolSt) = PoolingStrategy,

name(aCompInstP oolT yp_minimumInst) = minimumInstances, name(aCompInstP oolT yp_maxInst) = maximumInstances,

name(rCompInstP oolT yp_rep) = representative, name(rCompInstP oolT yp_st) = strategy The stereotypes extend the following classes:

ComponentInstancePooledType−extends−−−−→ ComponentType The attributes and references are defined as follows:

ComponentInstancePooledType.minimumInstances−−−−−−→ Int,isOf T ype ComponentInstancePooledType.maximumInstances−−−−−−→ Int,isOf T ype

ComponentInstancePooledType.representative cardinality

−−−−−−−→ 1..1,

ComponentInstancePooledType.representative−−−−−−→ ComponentInstance,isOf T ype

ComponentInstancePooledType.representative−−−−−−→ ComponentInstance,isOf T ype