SpeADL Minus Tutorial » Historique » Version 2
Anonyme, 06/10/2014 15:03
| 1 | 1 | Anonyme | h1. SpeADL Minus Tutorial |
|---|---|---|---|
| 2 | |||
| 3 | This is a tutorial for [[SpeADL Minus Reference|SpeADL⁻]]: creating a project, defining simple and composite components, implementing components. |
||
| 4 | |||
| 5 | h2. Objectives |
||
| 6 | |||
| 7 | The objective of this tutorial is to understand the basic workflow to follow when developing component-oriented applications with SpeADL in Eclipse/MAY. |
||
| 8 | |||
| 9 | We will create a simple composition of two components connected together following a typical client-server configuration. |
||
| 10 | The server will provide a service that will be used by the client. |
||
| 11 | They will be composed together in a big component. |
||
| 12 | A Java *main()* will be created to show how to execute the composition once. |
||
| 13 | A very simple GUI will be used to illustrate a self-contained component acting as an application. |
||
| 14 | |||
| 15 | h2. Installing Eclipse and MAY |
||
| 16 | |||
| 17 | This procedure is described on [[SpeADL MAY Project SetUp|this page]]. |
||
| 18 | |||
| 19 | h2. Creating a New Project |
||
| 20 | |||
| 21 | First, we must create a project to work. |
||
| 22 | |||
| 23 | In Eclipse, go to the menus : *File / New / Java Project*. |
||
| 24 | |||
| 25 | Enter _Tutorial 1_ as the project name, verify that the *execution environment JRE* is 1.5 or above. |
||
| 26 | |||
| 27 | As a start, create a package in the *src* folder called _tutorial1_. |
||
| 28 | |||
| 29 | h2. The Server Component |
||
| 30 | |||
| 31 | Create the following hierarchy of packages (See [[SpeADL Best Practices#Project Organisation|this best practice]] for details on the matter): |
||
| 32 | * _tutorial1.server_ |
||
| 33 | ** _impl_ |
||
| 34 | ** _interfaces_ |
||
| 35 | ** _datatypes_ |
||
| 36 | |||
| 37 | 2 | Anonyme | Create a SpeADL file: |
| 38 | * Right-click on tutorial1.server and select *New / File*. |
||
| 39 | * Enter _server.speadl_ as the file name. |
||
| 40 | 1 | Anonyme | |
| 41 | Define the namespace we are going to work in as well as the _Server_ component: |
||
| 42 | <pre> |
||
| 43 | namespace tutorial1.server { |
||
| 44 | component ServerComponentType { |
||
| 45 | |||
| 46 | } |
||
| 47 | } |
||
| 48 | </pre> |