## Factory Component

## Definition

A Factory Component is a deployable software generation unit aiming at producing assets from inputs assets.

## Motivation

A factory component is a component with a set of contracts as the factory component parameters, a set of viewpoints and a generation orchestration.

The purpose of factory components is to achieve simple to complex, small- to large-scale, and heterogeneous generations. Unlike to generators with a defined technical scope of generation (e.g., text or model transformation), a factory component can mix several generation techniques, produce complex assets, such as languages, framework or tools, and cover the complete production lifecycle of assets. An heterogeneous generation can be realized individually by a factory component or collectivelly by a set of factory components with a generation chain.

A factory component cannot assume alone complex generations. For this reason, it delegates them to other factory components by assembly. Every factory component has a generation objective and realizes the generation it is specialized for.

Regarding the process engineering, a factory component is an activity and contributes in the context of a work definition (cf. SPEM, e.g. with the notion of process, phase, iteration, activity). The intent is to progressively replace manual development tasks by automated tasks. Then, a factory component is not only a technique but becomes, when intensively used, a vector for common generation practices. Next, it becomes to structure the software practice and the communication language between project team members. Over the time, the stake is to develop sharable factory component portfolios, i.e. homogeneous groups of generation topics extensible by mutual team enrichment.

Figure 1. GLobal view of a Factory Component

## Structure

A factory component consists of:

- A set of contracts, for the declaration of the required parameters of the generation,
- A set of viewpoints for the declaration of the generation data organized by concerns,
- A generation orchestration.

Beyond this structure, a factory component is generally specialized in function of its contents. Some factory components just contain viewpoint information (e.g., domain models, model-to-model mapping), others conduct the generation, or some are a conglomerate of viewpoints and orchestration. A factory component is hyper-specialized when it contains only one information type, such as generation patterns on a generation topic.

## Relationships between factory components and factory component types

Two kinds of logical relationships exist between factory components.

Delegation relationship. A factory component delegates its work to another one. This implies that every used factory component has an identified generation role. The following figure presents a tool infrastructure factory component that delegates its generation to factory components for model management, model check, transformation and presentation with user interfaces. The model management API generation delegates its generation to two factory components, one for code generation (e.g., Java code) and another one for documentation (e.g., Java Doc.).

Resource provider relationship. In this case, a factory component has one or several viewpoints which provide generation information. For instance, a factory component contains generation patterns in a generation viewpoint (e.g., a web site generation).

Figure 2. Assembly of Factory Component

Finally, there are four types of factory components:

- Productive factory component: this kind of factory component is able to produce assets by itself,
- Assembly factory component: this kind of factory component delegates its generation to specialized factory components (i.e., productive or assembly factory components),
- Resource provider factory component: this kind of factory provides generation data, such as generation patterns or license policy,
- Conglomerate factory component: this kind of factory cumulates one or several of the previous factory component roles (i.e., productive, assembly, resource provider).

## Factory Component Lifecycle

A factory component can adopt three kinds of stage during its lifecycle: development, execution and exchange. The development, or edition, consists in defining and populating the factory component contents. The execution is the stage when a factory component is activated and produces the expected assets.

Figure 3. Factory Component Lifecycle

Exchange is the last state. A factory component exchange consists in publishing (i.e., exporting) and harvesting (i.e., importing) factory components between teams and team members. The team that reuses off-the-shelf factory components integrate them in its generation chain, or specialize them.

Development / execution / exchange is a first level of lifecycle. At the process level, there are complementary and inter-related lifecycles. There are in-the-small lifecycles, at the developer or team level, and in-the-large lifecycles at the company or community level where more and more complex factory component portfolio are developed and shared.