<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Using EMF and ATL to improve primitive types management in MDE proposals</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author>
							<persName><forename type="first">Juan</forename><forename type="middle">M</forename><surname>Vara</surname></persName>
							<affiliation key="aff0">
								<orgName type="department">Grupo de Investigación</orgName>
								<orgName type="institution">Universidad Rey Juan Carlos Madrid (España)</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Verónica</forename><surname>Bollati</surname></persName>
							<email>veronica.bollati@urjc.es</email>
							<affiliation key="aff0">
								<orgName type="department">Grupo de Investigación</orgName>
								<orgName type="institution">Universidad Rey Juan Carlos Madrid (España)</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Emanuel</forename><forename type="middle">A</forename><surname>Irrazábal</surname></persName>
							<email>emanuel.irrazabal@urjc.es</email>
							<affiliation key="aff0">
								<orgName type="department">Grupo de Investigación</orgName>
								<orgName type="institution">Universidad Rey Juan Carlos Madrid (España)</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Esperanza</forename><surname>Marcos</surname></persName>
							<email>esperanza.marcos@urjc.es</email>
							<affiliation key="aff0">
								<orgName type="department">Grupo de Investigación</orgName>
								<orgName type="institution">Universidad Rey Juan Carlos Madrid (España)</orgName>
							</affiliation>
						</author>
						<title level="a" type="main">Using EMF and ATL to improve primitive types management in MDE proposals</title>
					</analytic>
					<monogr>
						<imprint>
							<date/>
						</imprint>
					</monogr>
					<idno type="MD5">8BB4AFC343CA9F9F1DDF68987D4CEF61</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2023-03-24T17:42+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>Primitive Types Modeling</term>
					<term>Model Transformations</term>
					<term>ATL</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>An additional complexity inherent to any model-driven engineering proposal is the task of modeling the primitive types supported by each technological platform. If we want the models to be used as the input to generate directly the code that implements the system, the model has to be both complete and detailed. Otherwise, the code generation process results in mere skeletons of the working-code, requiring from a lot of handprogramming to have a fully operable system. This work sketches a simple, yet efficient technique for modeling of primitive types in platform specific models and shows its application for the modeling of Object-Relational databases. As well, we explore the implications of modeling primitive types in the development of model transformations. To that end, we specify a generic way of addressing this issue and show its application using again the Object-Relational databases modeling scenario.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1">Introduction</head><p>In recent years, Model Driven Engineering (MDE) <ref type="bibr" target="#b1">[2,</ref><ref type="bibr" target="#b16">18]</ref> and more specifically, Model-Driven Software Development (MDSD) have begun to achieve certain levels of maturity. MDSD proposes the use of models to represent the Information System (IS) at different abstraction levels. Such models are subsequently bridged by means of model (to model) transformations until their level of abstraction is that of the underlying platform. Then, a last step is encoded in another model (to text) transformation. All this given, the only way to get a full return of MDSD is by providing with the technical support for each task related with a MDSD proposal <ref type="bibr" target="#b0">[1]</ref>.</p><p>A huge amount of the proposals that have emerged during these years have followed the distinction of abstraction levels proposed by the OMG's Model-Driven Architecture (MDA) <ref type="bibr" target="#b12">[14]</ref>. This way, following the MOF specification <ref type="bibr" target="#b11">[13]</ref>, MDA defines three levels of abstraction for modeling purposes: system requirements are modeled by Computer Independent Model (CIM), whereas Platform Independent Models (PIM) are intended to represent the functionality and structure of the system without considering technical details of the targeted platform; finally, Platform Specific Models (PSM) are used to combine the specifications contained in the PIMs with the details of the selected platform. From the different PSMs one can automatically generate different implementations for the same system.</p><p>For the last step being performed, i.e. to carry out the last model to text transformation, we need from very accurate and detailed models that provide just with a thin abstraction layer over the working-code. In this context, one of the main challenges that MDE has to face in order to be adopted by the industry is the definition of more and more accurate DSLs <ref type="bibr" target="#b5">[6]</ref> that allows modeling the system in a very detailed way <ref type="bibr" target="#b3">[4,</ref><ref type="bibr" target="#b17">19]</ref>.</p><p>In this regard, a recurring problem is the management of primitive types. If your low-level models are meant to be used as mere plans of the underlying, the modeling of primitive types requires from special attention and treatment. Otherwise, the result of the code generation will be just a simple skeleton that needs to a lot of programming to become useful code. The latter was the way forward of the first CASE tools of the late 80s, such as Rational Rose and one of the main reasons for failure <ref type="bibr" target="#b6">[8]</ref>.</p><p>Using Database Management Systems (DBMS) as an example of technological platform, this work proposes a number of techniques to improve the management of primitive types in MDE proposals. Such techniques are structured into two main lines: support the modeling of primitive types in PSM models in an efficient and systematic manner and handling primitive types when developing model transformations, with special emphasis on horizontal transformations between PSM models. For each problem, we propose a generic technique enough to provide with a usable protocol for any given scenario. As well, we provide with a proof of concept. To that end, we present a DSL for modeling standard Object-Relational Database (ORDB) schemes and the transformation to move from such DSL to the corresponding one for Oracle. These DSLs as well as the transformation are bundled in M2DAT-DB (MIDAS MDA Tool for DataBases), a framework for model-driven development of modern DB schemas that support the whole development cycle, from PIM to working code <ref type="bibr" target="#b20">[22]</ref>.</p><p>This paper is organized as follows: Section 2 presents the main issues related with modeling of primitive data types in SQL:2003 and how EMF-tree like editors are adapted accordingly. Section 3 presents some techniques for primitive data type management in model transformation and illustrate them by means of two different scenarios. Finally, in section 4 presents the main conclusion and future works.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2">Modeling of primitive types in platform specific models</head><p>This section presents the technique proposed to model primitive types in platform specific models and its application to the definition of a DSL for modeling ORDB schemas conforming to the SQL:2003 standard <ref type="bibr" target="#b7">[9]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1">Modeling of primitive types</head><p>Typically, primitive type systems follow a hierarchical structure. One can infer such conclusion from reviewing and studying how some of the most common and adopted technological platforms, such as Java <ref type="bibr" target="#b4">[5]</ref> or the different DBs vendors implementing the SQL: 2003 standard <ref type="bibr" target="#b7">[9]</ref>, handle primitive types. The different groups and families of primitive types are subsequently specialized until reaching the leaves of the tree, where the concrete and instantiable types are found. For example, Fig. <ref type="figure">1</ref> shows the primitive types system of the DB2 DBMS <ref type="bibr">[7]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Fig. 1. Primitive types system of DB2</head><p>When defining a DSL to model DB schemas, this fact hampers the definition of the underlying metamodel that captures the abstract syntax of the DSL. Although hierarchical structures are simple to model, the large number of final elements or leaves that have to be included adds complexity to the metamodel, and consequently to any terminal model conforming to such metamodel. An alternative is grouping together into families of data types the leaves of the tree and using enum data types to identify which specific type is.</p><p>Fig. <ref type="figure" target="#fig_0">2</ref> shows a partial view of the SQL:2003 metamodel defined this way. However, for each data type we have to consider a set of inherent features. When a given primitive type is used to define the type of an element in the model, we have to assign a value for each feature (even if we decide for using default values, we need a way to do so). That assignment is valid just for that specific use of the data type. For example, Fig. <ref type="figure">3</ref>   </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Fig. 3. Using features to restrict the size of character type elements</head><p>To address this issue we advocate in favor of modeling such features while keeping a reasonable level of complexity in the DSL metamodel. The proposal can be decomposed into two steps:</p><p>On the one hand, adding a new metaclass (Feature) to represent the features inherent to any given primitive type. This metaclass is later specialized to define a valid set of features metaclasses for each family of types. Each specialization consists of a key-value pair. The key is defined over an enum data type that collects the valid features for each final type. The value represents the value assigned to that feature for that specific use of the primitive data type.</p><p>On the other hand, each model element which may be typed by means of a primitive type might contain several feature objects. Those objects model the features of the primitive type when it is used to type the given object. Fig. <ref type="figure" target="#fig_1">4</ref> shows the result of applying the technique sketched to the previous example. Again, the columns Name and Address use the same data type, but each one customizes the data type according to their needs. To that end, both Address and Name include a feature object whose possible values for the key are taken from an enumerated data type that specifies which the valid features characteristics of character data types are.  Nevertheless, by extending the DSL metamodel to support the modeling of primitive types, we are also widening the range of terminal models that are valid (syntactically speaking). However, the specification of the abstract syntax of a DSL is not limited to the definition of the metamodel. To complete the specification we might add constraints at metamodel level to gather those domain rules that cannot be directly reflected in the metamodel. Later on, we will show how we have addressed this task during the implementation of the proposed technique.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>CUSTOMER Name Address</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2">Modeling of primitive types in SQL:2003</head><p>In the following, we show the result of applying the technique described above to the specification of a DSL for modeling ORDB schemas conforming to the SQL:2003 standard.</p><p>Fig. <ref type="figure" target="#fig_2">5</ref> shows a partial view of the metamodel which defines the abstract syntax of the DSL focused in the metaclasses related with representing primitive types.  Note that it also follows a hierarchical pattern: the features are grouped together into families that match the existing families of primitive data types. Primitive data types are used to type columns or attributes, both factorized in the Structural Component metaclass. Therefore, each Structural Component can contain a set of Feature objects. They serve to specify the value for the features of the primitive type over which the given column or attribute is defined. Finally, the values that the key property can take vary from one family of primitive data types to the other. Thus, an enumerated data type collects the valid values for each case. For instance, we can fix the precision of a Datetime column/attribute or we can set the scale of a Numeric column/ attribute.</p><p>At the end of previous section we put forward the need to attach a number of restrictions to the metamodel to complete the specification of the DSL abstract syntax. In particular, we must control which are the features that can be attached to any model element: just those inherent to the primitive data type used to type the object.</p><p>Although there are several ways to define metamodel level constraints that are later checked at model level, the most accepted in the context of MDE is the use of OCL (or an OCL-based language). In this work, we use the Epsilon Validation Language <ref type="bibr" target="#b9">[11]</ref> (EVL) to complete the DSL specification. EVL extends the OCL capabilities in terms of model validation: it improves OCL expressiveness in order to ease the coding of constraints and model navigation, it bundles an API to provide with user feedback on constraints violation in a friendly manner, it support the definition of fixes, that are actions to repair any detected inconsistency , etc. To show a simple example of the use of EVL in this work, Fig. <ref type="figure">7</ref> shows one of the EVL restrictions coded. In particular, an invariant that ensures that only character features can be attached to model objects whose type is one of those from the family of character data types. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Fig. 7. EVL invariant to ensure correct use of character features</head><p>To conclude this section, Fig. <ref type="figure">8</ref> shows an example of use of the DSL specified following the proposed technique. We focus on how to add a new feature to a particular attribute.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Fig. 8. Modeling of characteristic in elements defined on pritimitve types</head><p>First, we add a Feature object, in the country attribute. Since the type of the attribute is character (CHARACTERVARYING), the Feature object is an instance of the StringFeature class. Indeed, if we try to use any other Feature subclass, model validation would raise an error. Next, we use the key-value properties of the feature object to set the size (length) of the attribute. Finally, we show how the result is displayed in the (improved) EMF-tree editor: the country attribute is of CHARACTERVARYING and its length is limited to 25 chars. Note that, proceeding this way, the model contains all the information needed to generate the SQL script that implements the modeled scheme.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3">Customizing EMF-tree like editors to improve primitive types management</head><p>The specification of a DSL supporting the entire system of primitive data types of a specific platform requires conducting certain considerations in terms of usability of the associated DSL toolkit. Indeed, usability has been widely acknowledged as one of the main issues of existing tooling for MDE nowadays <ref type="bibr" target="#b15">[17]</ref>.</p><p>As we will show in this section, deploying the presented proposal for modeling primitive types has a direct impact over the usability of the EMF-tree like editors bundled in the DSL toolkit. Therefore in the following we show how we mitigate this impact by customizing such editors to improve their level of usability.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Automatic inclusion of primitive types in PSM models.</head><p>When working with PSMs models we have to model explicitly each primitive data type to be used. For example, back to the DSL we are using as proof of concept for this work, if we want a model element to be of CHARACTER VARYING type, we must instantiate the Character String metaclass in the model and assign the value CHARACTER VARYING to the descriptor property descriptor of such object.</p><p>To address this issue we propose to follow the practice adopted by commercial modeling tools. They use to include by default all the primitive data types supported by the targeted platform in any new model. Thus, the user has only to choose the most appropriate for each model element. Following this practice we propose to modify the code generated by EMF so that every time you create a new PSM model, metaclasses abstracting primitive data types are automatically instantiated.</p><p>Fig. <ref type="figure" target="#fig_4">9</ref> shows the result of using the generic EMF editor (a) versus using the improved one (b). In both cases the purpose is the same: using the CHARACTERVARYING type to type the Name attribute of the structured type Person_Type. However, when we use de editor generated by EMF (a), we need first to create a Character String Type object. Furthermore, we can only use this type and the Person_Type type to define the type of the attribute (i.e. only those types that have been previously created on the model can be used in new objects).</p><p>By contrast, when using the custom editor (b), we can use any of the primitive types supported by the SQL: 2003 standard, since they have been all instantiated at the time of creating the model. Of course, this instantiation process remains hidden for the final user.</p><p>Finally, it should be mentioned that by applying this technique on the tree-like editor of EMF, the functionality is automatically reflected in the diagrammer built with the Generic Modeling Framework <ref type="bibr" target="#b18">[20]</ref> (GMF), since the code that implements the latter is partially based the one implementing the former.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Filtering of primitive data types.</head><p>If the improvement of the EMF editor is limited to including by default the set of primitive data types supported by the platform, the result may still be unwieldy since the model will include a large number of objects -those that represent each one of the primitive data types, which are not really relevant for the construction of the model. In fact, these objects will not be modified during model edition: they are created at the time the model is created and play a secondary role for the rest of the modeling process. They are simply used to define the type of other model elements. Despite that, they only serve to add noise to any view of the model.</p><p>Therefore, we have decided to customize EMF editors in order to filter the set of displayed objects, so that primitive data types remain hidden and they are only shown when they are really needed, i.e. when the user has to set the type for a given attribute or column. To that end, the set of available primitive data types is displayed in the combo box shown in the properties view that allow defining the type of any given object of the model (see Fig. <ref type="figure" target="#fig_4">9-b</ref>).</p><p>Fig. <ref type="figure" target="#fig_5">10</ref> shows the difference between using a non-improved editor, where primitive data types have not been filtered (a) versus one in which the filtering is applied (b). Note that, for the sake of space, just a very few number from the set of the primitive data types supported is shown; otherwise, the figure had been too large. Although the functionality provided by both editors is exactly the same -both allow you to use any of the primitive data types supported by SQL: 2003 to define the type of a model element, their levels of usability differ widely. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3">Primitive types management in model transformations</head><p>So far, we have shown how to address the specification of a DSL that supports modeling of primitive data types in a complete, correct and detailed enough manner to use any model as input for a code generator. From now on, we focus on the implications of modeling primitive data types with regard to the development of model transformations in which models. Moreover, we show how we address these concerns using the ATL transformation language <ref type="bibr" target="#b8">[10]</ref>.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.1">Vertical transformations (PIM2PSM)</head><p>In general, PIM to PSM mappings does not need from additional considerations, since the primitive data types considered at PIM level, which use to be reduced to an integer type, a character type, and optionally a boolean type, are mapped to one of the primitive data types supported by the targeted platform. To do so, we just need to add a set of matched rules to map each primitive data type included in the PIM.</p><p>Besides, according to the editor's improvements presented in section 2.3, the transformation has to take care of creating the objects needed to model whole set of primitive data types in the target model. This way, we are ensuring that the designer can use them in order to refine the model obtained. To do so, we just need to include an imperative rule that create such objects. In particular, it is an end point rule, an ATL rule that is automatically executed just before the transformation execution is finished.</p><p>Continuing with the DSL for ORDB modeling, Fig. <ref type="figure" target="#fig_6">11</ref> shows the imperative rule included in the UML2SQL2003 ATL transformation developed to move from pure conceptual data models to ORDB schemas for the SQL:2003 standard. Note that it only contains a target pattern, i.e. it just instantiate new objects in the target model, without the need for a previous matching with some source elements.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.2">Horizontal transformations (PSM2PSM)</head><p>The task of mapping primitive types in PSM2PSM transformations is more challenging. Apart from mapping the primitive types, we need to map the features that each element uses to customize the primitive data type used.</p><p>We propose two different techniques to tackle these issues: one for mapping the primitive data type objects, and, another one for the Feature objects. Next, we introduce them using the SQL20032ORDB4ORA transformation bundled in M2DAT-DB <ref type="bibr" target="#b20">[22]</ref>. It maps ORDB schemas conforming to the SQL:2003 standard to ORDB schemas for Oracle. In general, all scenarios but the last one can be addressed by means of fairly intuitive rules, or at least, they can be decomposed into simpler scenarios. Therefore we will focus on the last one: when multiple source types have to be mapped to the same type in the target model. This scenario is more complex by nature.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Mapping primitive data type objects.</head><p>Indeed, a great part of the logic of a (declarative) model transformation resides largely on the automatic management of the traces between elements from source and target models. Any reference to a source element in a target pattern is automatically replaced to a reference to the corresponding target element. However, in a N:1 scenario like the one we tackle here, we cannot use automatic traces management, since the target type corresponds to several source types: which one should be use to refer to the desired target type?. For example, both the CHAR and NCHAR data types from the SQL:2003 standard correspond to a single data type in Oracle: CHARACTER.</p><p>To address this issue we propose a two steps solution:</p><p>First, we choose one of the source types (so-called hidden types) and map it to the desired target type. We refer to this source type as mirror type Then, each reference in the source model to one of the hidden types has to be replaced by a reference to the mirror type. This way, when the transformation is run, the engine resolves every reference to the mirror type by a reference to the appropriate target type. The encoding of the first step is immediate. For example, Fig. <ref type="figure" target="#fig_0">12</ref>(a) shows the rule that allows mapping the NUMERIC data type from Oracle to SQl:2003. On the other hand, Fig. <ref type="figure" target="#fig_0">12(b)</ref> shows how the second step is articulated when mapping PARAMETER objects. When there is a need of referencing a primitive data type from source model, the mirrorType () helper is invoked. Such helper returns the corresponding mirror data type. That is, the source data type of the matched rule coded in the previous step. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4">Conclusions</head><p>This work has introduced a number of techniques to improve the management of primitive data types in platform specific models. To that end, we have defined a series of systematic steps that allow, on the one hand, to model completely and correctly the system of primitive data types supported by each platform and, on the other hand, to keep consistent such information when the models are the source and/or the target of a model transformation.</p><p>The proposed techniques are original, simple and intuitive and we have provided with a proof of concept by showing their application in the development of a toolkit for model-driven development of ORDB schemas. The results, in terms of usability and completeness of the models developed, are quite successful.</p><p>With regard to the development of model transformations, the steps are intuitive and the task of programming the proposed techniques is not very complex. Though we have not included a complete case study for the sake of space, we have shown that the proposed solution works correctly in all scenarios identified.</p><p>It is worth mentioning that even though the implementation presented has been created using EMF as (meta)modeling framework, the underlying ideas can be easily deployed in other frameworks, such as GME <ref type="bibr" target="#b2">[3]</ref>. Similarly, the implementation with ATL could be extrapolated to other languages adopting a hybrid approach, but essentially declarative, such as RubyTL <ref type="bibr" target="#b14">[16]</ref>, Tefkat <ref type="bibr" target="#b10">[12]</ref> or any implementer of QVT-Relations <ref type="bibr" target="#b13">[15]</ref>.</p><p>As future work, we plan to automate the proposal using MDE techniques. Therefore, we are working to modify EMF generation templates in order to integrate the facilities for primitive data types management in any EMF-editor. As well, we work to be able to generate automatically the ATL code that implements the mapping rules for primitive data types from weaving models representing the relationships between them. In the future, such relationships should be discovered automatically by means of model matching techniques.</p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Fig. 2 .</head><label>2</label><figDesc>Fig. 2. Partial view of the primitive types system of the SQL:2003 standard</figDesc><graphic coords="3,153.16,497.11,289.10,195.45" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Fig. 4 .</head><label>4</label><figDesc>Fig. 4. Using feature objects to model the restriction of size for character data types</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>Fig. 5 .</head><label>5</label><figDesc>Fig. 5. Partial view of the SQL:2003 metamodel: primitive types</figDesc><graphic coords="5,115.53,508.07,364.13,174.61" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_3"><head>Fig. 6 .</head><label>6</label><figDesc>Fig. 6. Partial view of the SQL:2003 metamodel: features.</figDesc><graphic coords="6,108.18,170.46,376.88,136.84" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_4"><head>Fig. 9 .</head><label>9</label><figDesc>Fig. 9. Assigning primitive types in EMF editors: (a) Generic editor (b) Improved editor</figDesc><graphic coords="8,103.86,141.76,387.85,148.95" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_5"><head>Fig. 10 .</head><label>10</label><figDesc>Fig. 10. Filtering of primitive types in EMF editors</figDesc><graphic coords="9,113.40,145.10,119.43,63.85" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_6"><head>Fig. 11 .</head><label>11</label><figDesc>Fig. 11. ATL rule to create primitive types (UML2 to SQL2003)</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_7"><head>Fig. 14 .</head><label>14</label><figDesc>Fig. 14. Mapping rule for Features objects: SQL:2003 to Oracle</figDesc><graphic coords="12,103.86,141.76,387.85,113.05" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0"><head></head><label></label><figDesc></figDesc><graphic coords="7,103.76,141.76,388.05,138.75" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_0"><head></head><label></label><figDesc>shows a Customer table owning two columns: Name and Address, both of Character type. We can set different values for the size feature, which restricts the maximum size that can reach each column.</figDesc><table /><note>CUSTOMERName Address CHARACTER SIZE: 50 SIZE: 100</note></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_1"><head>TABLE DATATYPE</head><label>DATATYPE</label><figDesc></figDesc><table /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_2"><head>TABLE KEY :</head><label>KEY</label><figDesc></figDesc><table><row><cell>ATTRIBUTE</cell><cell></cell><cell>String Features ENUMERATION</cell></row><row><cell></cell><cell></cell><cell>-SIZE</cell></row><row><cell></cell><cell>FEATURE</cell><cell>-UNIT</cell></row><row><cell></cell><cell>KEY: SIZE (EEnum)</cell><cell>-MULTIPLIER</cell></row><row><cell>ATTRIBUTE</cell><cell>VALUE: 50</cell></row><row><cell></cell><cell></cell><cell>DATATYPE</cell></row><row><cell></cell><cell>FEATURE</cell><cell>CHARACTER</cell></row><row><cell></cell><cell>SIZE (EEnum)</cell></row><row><cell></cell><cell>VALUE: 100</cell></row></table></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" type="table" xml:id="tab_4"><head>Table 1 .</head><label>1</label><figDesc>Table 1 identifies the most common scenarios that can occur in terms of correspondence between primitive data type systems of different platforms Scenarios in primitive data types management for PSM2PSM transformations</figDesc><table><row><cell>SOURCE MODEL</cell><cell>TARGET MODEL</cell></row><row><cell>One source type</cell><cell>One target type</cell></row><row><cell>One source type</cell><cell>Any target type</cell></row><row><cell>One source type</cell><cell>Multiple target type</cell></row><row><cell>Any source type</cell><cell>One target type</cell></row><row><cell>Multiple source type</cell><cell>One target type</cell></row></table></figure>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Acknowledgment.</head><p>This research has been carried out in the framework of the projects: MODEL-CAOS (TIN2008-03582/TIN), AGREEMENT-TECHNOLOGY (CSD2007-0022) both project financed by the Spanish Ministry of Education and Science and the IDONEO project (PAC08-0160-6141) financed by "Consejería de Ciencia y Tecnología de la Junta de Comunidades de Castilla-La Mancha".</p></div>
			</div>

			<div type="annex">
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.3">Mapping Features</head><p>Finally, once primitive data types are correctly mapped, we need to address the mapping of the feature objects that allow customizing or restricting the use of such data types. Notice that only those source features with a corresponding feature in the target model could be mapped. The rest of information on features is lost. However, if such information is considered relevant, a valid and affordable alternative would be to add annotations to the target model to collect such data.</p><p>To illustrate the technique proposed, Fig. <ref type="figure">13</ref> shows how the mapping of features is solved when transforming attributes from a SQL:2003 model to the one for Oracle. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Fig. 13. Mapping rule for Attribute objects: SQL:2003 to Oracle</head><p>Whenever an Attribute is mapped, its features have to be mapped as well. To that end, we first select just those features that have a correspondent feature on the target metamodel. To filter them we use the haveLegalTarget() helper. Then, we invoke the rule that creates the target feature (Feature2Feature()) (see Fig. <ref type="figure">14(a)</ref>).</p><p>Indeed, the Feature2Feature rule is an abstract rule. It maps the source key-value pair to the target key-value pair. To that end, two different helpers return the target key and the target value for each source key and source value. Taking advantage from ATL rule inheritance, the rule is later specialized for each family of primitive types. For instance, Fig. <ref type="figure">14(b)</ref> shows how the rule is specialized for the families of String (1) and Numeric (2) primitive data types.</p></div>			</div>
			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<analytic>
		<title level="a" type="main">Model-driven development: a metamodelling foundation</title>
		<author>
			<persName><forename type="first">C</forename><surname>Atkinson</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Kuhne</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">IEEE Software</title>
		<imprint>
			<biblScope unit="volume">20</biblScope>
			<biblScope unit="issue">5</biblScope>
			<date type="published" when="2003">2003</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">In search of a Basic Principle for Model Driven Engineering</title>
		<author>
			<persName><forename type="first">J</forename><surname>Bézivin</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Novatica/Upgrade</title>
		<imprint>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="21" to="24" />
			<date type="published" when="2004">2004</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">GME: the generic modeling environment</title>
		<author>
			<persName><forename type="first">J</forename><surname>Davis</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">18th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications. OOPSLA &apos;03</title>
				<meeting><address><addrLine>Anaheim, USA</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2003">2003</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Code Generation for Dummies</title>
		<author>
			<persName><forename type="first">M</forename><surname>Fowler</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Methods and Tools</title>
				<meeting><address><addrLine>Spring</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2009">2009. 2009</date>
			<biblScope unit="page" from="65" to="82" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<monogr>
		<title level="m" type="main">The Java Specification</title>
		<author>
			<persName><forename type="first">B</forename><surname>Gosling</surname></persName>
		</author>
		<author>
			<persName><forename type="first">G</forename><surname>Steele</surname></persName>
		</author>
		<imprint>
			<date type="published" when="1996">1996. 1996</date>
			<publisher>Addison-Wesley</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<monogr>
		<title level="m" type="main">Eclipse Modelling Project: A Domain-Specific Language (DSL) Toolkit</title>
		<author>
			<persName><forename type="first">R</forename><forename type="middle">C</forename><surname>Gronback</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2009">2009</date>
			<publisher>Addison-Wesley Professional</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">Why are CASE tools not used?</title>
		<author>
			<persName><forename type="first">J</forename><surname>Iivari</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Communications of the ACM</title>
		<imprint>
			<biblScope unit="volume">39</biblScope>
			<biblScope unit="issue">10</biblScope>
			<biblScope unit="page" from="94" to="103" />
			<date type="published" when="1996">1996</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<monogr>
		<idno>ISO/IEC 9075: 2003</idno>
		<title level="m">Information technology -Database languages -SQL</title>
				<imprint>
			<date type="published" when="2003">2003</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">ATL: a model transformation tool</title>
		<author>
			<persName><forename type="first">F</forename><surname>Jouault</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Allilaire</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Bézivin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Kurtev</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">Science of Computer Programming</title>
		<imprint>
			<biblScope unit="volume">72</biblScope>
			<biblScope unit="issue">1-2</biblScope>
			<biblScope unit="page" from="31" to="39" />
			<date type="published" when="2008">2008</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Eclipse Development Tools for Epsilon, Eclipse</title>
		<author>
			<persName><forename type="first">D</forename><surname>Kolovos</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Paige</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Polack</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Summit Europe, Eclipse Modeling Symposium</title>
				<meeting><address><addrLine>Esslingen, Germany</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2006">2006</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">Implementing a practical declarative logic-based model transformation engine</title>
		<author>
			<persName><forename type="first">M</forename><surname>Lawley</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Raymon</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">ACM symposium on Applied computing 2007 (SAC 2007</title>
				<meeting><address><addrLine>Seoul, Korea</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2007">2007</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<monogr>
		<author>
			<persName><surname>Omg</surname></persName>
		</author>
		<idno>/06-01-01</idno>
		<title level="m">The Meta Object Facility (MOF), Version 2.0</title>
				<imprint/>
	</monogr>
	<note>OMG Document -formal</note>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title/>
		<idno>omg/2003-06-01</idno>
	</analytic>
	<monogr>
		<title level="j">OMG. MDA Guide Version</title>
		<editor>Miller, J. y Mukerji, J.</editor>
		<imprint>
			<biblScope unit="volume">1</biblScope>
		</imprint>
	</monogr>
	<note>0.1 Document number</note>
</biblStruct>

<biblStruct xml:id="b13">
	<monogr>
		<author>
			<persName><surname>Omg</surname></persName>
		</author>
		<idno>/08-04-03</idno>
		<title level="m">MOF 2.0 Query/View/Transformation (QVT)</title>
				<imprint/>
	</monogr>
	<note>V1.0. OMG Document -formal</note>
</biblStruct>

<biblStruct xml:id="b14">
	<analytic>
		<title level="a" type="main">RubyTL: A Practical, Extensible Transformation Language</title>
		<author>
			<persName><forename type="first">J</forename><surname>Sánchez Cuadrado</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>García Molina</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Menarguez Tortosa</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">ECMDA-FA 2006</title>
				<meeting><address><addrLine>Bilbao, Spain</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2006">2006</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b15">
	<analytic>
		<title/>
		<author>
			<persName><forename type="first">B</forename><surname>Selic</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">MDA Manifestations. UPGRADE</title>
		<imprint>
			<biblScope unit="volume">IX</biblScope>
			<biblScope unit="issue">2</biblScope>
			<biblScope unit="page" from="12" to="16" />
			<date type="published" when="2008">2008</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b16">
	<analytic>
		<title level="a" type="main">The pragmatics of Model-Driven development</title>
		<author>
			<persName><forename type="first">B</forename><surname>Selic</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="j">IEEE Software</title>
		<imprint>
			<biblScope unit="volume">20</biblScope>
			<biblScope unit="issue">5</biblScope>
			<biblScope unit="page" from="19" to="25" />
			<date type="published" when="2003">2003</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b17">
	<analytic>
		<title level="a" type="main">Challenges in Model-Driven Software Engineering</title>
		<author>
			<persName><forename type="first">R</forename><surname>Straeten</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Mens</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Baelen</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Models in Software Engineering: Workshops and Symposia At MODELS 2008</title>
				<meeting><address><addrLine>Toulouse, France</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2009">2009</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b18">
	<analytic>
		<title level="a" type="main">Introduction to the Graphical Modeling Framework</title>
		<author>
			<persName><forename type="first">A</forename><surname>Tikhomirov</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Shatali</surname></persName>
		</author>
	</analytic>
	<monogr>
		<title level="m">Tutorial at the EclipseCON 2008</title>
				<meeting><address><addrLine>Santa Clara, California</addrLine></address></meeting>
		<imprint>
			<date type="published" when="2008">2008</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b19">
	<monogr>
		<title level="m" type="main">Supporting Model-Driven Development of Object-Relational Database Schemas: a Case Study ICMT2009</title>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">M</forename><surname>Vara</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><surname>Vela</surname></persName>
		</author>
		<author>
			<persName><forename type="first">V</forename><surname>Bollati</surname></persName>
		</author>
		<author>
			<persName><forename type="first">E</forename><surname>Marcos</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2009">2009</date>
			<pubPlace>Zurich, Switzerland</pubPlace>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b20">
	<monogr>
		<title level="m" type="main">M2DAT: a Technical Solution for Model-Driven Development of Web Information Systems</title>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">M</forename><surname>Vara</surname></persName>
		</author>
		<ptr target="http://www.kybele.etsii.urjc.es/members/jmvara/Thesis/" />
		<imprint>
			<date type="published" when="2009-04">2009. April 2009</date>
		</imprint>
		<respStmt>
			<orgName>University Rey Juan Carlos</orgName>
		</respStmt>
	</monogr>
	<note type="report_type">Ph.D. Thesis</note>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
