• Tidak ada hasil yang ditemukan

Tutorial UML Translation to ABS - RSE - Fasilkom UI

N/A
N/A
Protected

Academic year: 2023

Membagikan "Tutorial UML Translation to ABS - RSE - Fasilkom UI"

Copied!
13
0
0

Teks penuh

(1)

FORMAL METHODS IN SOFTWARE ENGINEERING LABORATORY FAKULTAS ILMU KOMPUTER UNIVERSITAS INDONESIA

Tutorial UML Translation to ABS

Maya Retno Ayu Setyautami [email protected]

(2)

UML Translation to ABS Page 2

Table of Contents

1. Installation ... 3

1.1 UML Class Diagram Editor ... 3

1.2 Acceleo Model to Text Transformation (M2T) ... 3

1.3 ABS Tool ... 4

2. Import ABS Profile ... 4

3. Create UML Class Diagram ... 4

4. Refactoring (Create UML Class Diagram with ABS Profile) ... 8

4. 1 Applying ABS Profile ... 9

4. 2 Draw UML Class Diagram with ABS Profile ... 10

5. Translation to ABS Model with Acceleo M2T ... 12

(3)

UML Translation to ABS Page 3

1. Installation

UML class diagram translation to ABS can be done automatically in Eclipse IDE. Eclipse plugins which are required to do the translation process, are:

1.1 UML Class Diagram Editor

UML class diagram is the input for the translation process. We can create UML class diagram in Eclipse by installing UML class diagram editor. There are several plugins for UML class diagram editor. In this tutorial, we used Papyrus for creating UML class diagram in Eclipse.

Form Eclipse choose Menu Help Install Modeling Components Choose Papyrus in Modeler Part Finish

1.2 Acceleo Model to Text Transformation (M2T)

Rules for UML class diagram translation to ABS are implemented in Acceleo M2T. Thus, to run the translation process, we need to install plugin Acceleo M2T. From Eclipse, choose Menu Help Install Modeling Components Choose Acceleo in Model to Text Part Click Finish.

(4)

UML Translation to ABS Page 4

1.3 ABS Tool

Output from translation process is ABS model. To build and debug the ABS model, we need to install ABS tool eclipse plugin from HATS Project. It is available in http://tools.hats- project.eu/update-site.

2. Import ABS Profile

We have to import ABS profile to Eclipse in order to create UML class diagram with ABS Profile. Without this profile, we can’t draw UML class diagram with ABS element on the Eclipse.

Steps:

1. Download file ABS Profile from https://projects.ui.ac.id/snv/abs/UML- ABS/ABSProfile.zip

2. Import the project to Eclipse

3. Make sure that there is ProfileABS Project in Package Explorer. There is also folder ProfileABS in your workspace, include file:.project; model.profile.di;

model.profile.notation; model.profile.uml

3. Create UML Class Diagram

You may create UML class diagram in other eclipse UML editor. For this tutorial, we use Papyrus as UML class diagram editor. Make sure you have done Section 1.1 and papyrus plug-ins had been installed on your eclipse.

(5)

UML Translation to ABS Page 5 Steps:

1. [Optional] Open Perspective Papyrus, choose Menu Window  Open Perspective  Other  Papyrus  Click OK

2. Choose Menu File New Project Papyrus Papyrus Project

3. Input Project Name, for example AccountUML, Click Next

4. On the wizard Select language of the diagram, Choose UML, click Next

5. On the wizard Initialization Information, Choose UML Class Diagram and checklist menu you can load a template: A UML Model with basic primitive types …Click Finish.

(6)

UML Translation to ABS Page 6 6. After creating project AccountUML, you will see UML editor Papyrus like the picture

below:

Space: UML Editor

Properties Menu

Palette Menu

(7)

UML Translation to ABS Page 7 Supposed we will create UML class diagram for Account Case Study, as shown in the picture below:

Steps:

1. Drag nodes Class from Palette menu to Space: UML editor to create new Class, for example class Account.

2. Drag nodes Property from Palette menu to Class Account for adding attribute from Class Account. Edit attribute’s properties (name, type, visibility, etc.) on the Properties menu.

(8)

UML Translation to ABS Page 8 3. Drag nodes Operation from Palette menu to Class Account for adding method from Class

Account. Edit method’s properties (name, return type, input, output, visibility, etc.) on the Properties menu.

4. Refactoring (Create UML Class Diagram with ABS Profile)

Refactoring is the second step which is required on the translation process. It is done manually by user and produce UML class diagram with ABS Profile. The result of refactoring for UML class diagram Account case study can be seen in the picture below.

(9)

UML Translation to ABS Page 9

4. 1 Applying ABS Profile

To create UML class diagram with ABS Profile, we will use ABS Profile that had been imported on the Eclipse. Make sure that you have done all steps on the Section 2, import ABS Profile.

Steps:

1. On the diagram accountABS.di, choose field Profile on the Properties Menu.

2. Apply ABS Profile to UML class diagram by choosing sign (+) on the menu Profile Application and the list of project from the package explorer will be shown. Choose model.profile.uml from ProfileABS folder that has been imported. Click OK. Choose ABSProfile, Click Ok.

3. After applying ABS Profile, there is ABSProfile on the field profile application in the properties menu accountABS.di. It indicates that UML class diagram used ABS Profile and we can draw UML class with ABSProfile element.

(10)

UML Translation to ABS Page 10

4. 2 Draw UML Class Diagram with ABS Profile

Mostly, drawing UML class diagram with ABS profile mechanism similar to the drawing UML class diagram that explained on the Section 3. The difference is that we need to add stereotype information on the UML class diagram with ABS profile, such as <<absClass>>,

<<absDelta>>, <<adds>>, <<modifies>>, <<removes>>, etc.

For example, supposed we want to draw Class<<absDelta>>AccountWithFee from Case Study Account as shown in the picture below.

Steps:

1. Create Class with Stereotype ABS Profile

 Drag nodes Class from Palette menu to create new Class, class name is AccountWithFee.

 On the Properties menu, Choose Profile Choose sign (+) on the Applied Stereotypes Choose absClass

2. Create Attributes with Stereotype ABS Profile

 Drag nodes Property from Palette menu to Class AccountWithFee to add its attributes.

 Edit attributes property on Properties menu, field UML, attributes name is fee, type is integer

 On the Properties menu, Choose Profile Choose sign (+) on the Applied Stereotypes Choose absClass

(11)

UML Translation to ABS Page 11 3. Create Method with Stereotype ABS Profile

 Drag nodes Operation from Palette menu to Class AccountWithFee to add its method.

 Edit attributes property on Properties menu, field UML, method name is deposit, with two parameter, type is integer, and return type is integer

 On the Properties menu, Choose Profile Choose sign (+) on the Applied Stereotypes Choose modifies.

Complete the diagram by drawing all classes from UML class diagram with ABS Profile for Account problem, as shown on the Section 4.

(12)

UML Translation to ABS Page 12

5. Translation to ABS Model with Acceleo M2T

Translation from UML class diagram to ASB is implemented in Acceleo M2T. You have to import the code for translation rules and then run the Acceleo to generate ABS model from UML class diagram.

Steps:

1. Download file AcceleoUML2ABS.zip from https://projects.ui.ac.id/svn/abs/UML- ABS

2. Import the project to Eclipse and make sure there is a folder

org.eclipse.acceleo.module.ABSProfile in Package Explorer and workspace.

3. Open project org.eclipse.acceleo.module.ABSProfile  folder src package org.eclipse.acceleo.module.sample.common

4. Right click on file generate.mtl, choose Run As  run configurations. Acceleo Application New_Configuration will appear as follows.

(13)

UML Translation to ABS Page 13

 Fill project column with project’s name: org.eclipse.acceleo.module.ABSProfile

 Fill the main class column with module Generate from org.eclipse.acceleo.module.sample.ABSProfile

 Fill the Model column with your UML class diagram with ABS Profile which is used as input. For example: accountABS.uml

 Fill the Target column with folder’s name to save the translation output (You may create new folder here). For example result abs.

5. Click Apply  Run

6. Open folder result-abs to see the result of translation. Based on input UML class diagram Account with ABS Profile, there are 3 output ABS model: Account.abs, AccountWithFee.abs, dan AccountWithOverdraft.abs.

Referensi

Dokumen terkait

https://doi.org/ 10.1017/jie.2019.13 Received: 17 September 2018 Revised: 17 October 2018 Accepted: 23 April 2019 First published online: 2 September 2019 Key words: Aboriginal

5  ProductConfiguration Contoh product configuration pada AccountABS dapat dilihat pada AccountPL.abs Padaproduct configuration terdapat tigabagian yang penting yaitu: 