Getting started with PAMELA
There are several way to get and/or use Pamela.
- You just want to use (test) PAMELA (you are a developer and you want to define your first PAMELA model)
- You want to download PAMELA sources, review the code, run the tests, define your own annotations, implementations, and contribute to the project
1. You want to use PAMELA
You just need to bring Pamela artifacts in your environment.
- The Pamela artifacts (official releases) are published in the following maven repository https://maven.openflexo.org/artifactory/openflexo-release
- The Pamela artifacts (snapshot releases) are published in the following maven repository https://maven.openflexo.org/artifactory/openflexo-deps
- 1.5 is the last stable version
- 1.6.1(-SNAPSHOT) is the current development version (default)
Prerequisite
- Maven or Gradle
- Using an IDE (such as Eclise or IntelliJ) is recommended and might help
- As a developper tool, this "Getting started" supposes that you are familiar with development tools such as gradle or maven, and IDE manipulations.
1.1. Use PAMELA with gradle
It's easy to use it from Gradle.
In order to use Pamela in your gradle project, add the repository adding the following in the build.gradle
:
maven {
url "https://maven.openflexo.org/artifactory/openflexo-release/"
}
or to use a SNAPSHOT version
maven {
url "https://maven.openflexo.org/artifactory/openflexo-deps/"
}
Add also the dependency to the pamela-core
artifact (Java 8 required):
implementation group: 'org.openflexo', name: 'pamela-core', version: '1.5'
or to use a SNAPSHOT version (Java 11 or later required):
implementation group: 'org.openflexo', name: 'pamela-core', version: '1.6.1-SNAPSHOT'
Important notice : Note that Java 8 (1.8) is required for 1.5 last stable version but Java 11 is required from 1.6.1 version.
1.2. Use PAMELA with Maven
In order to use Pamela in your maven project, add the repository adding the following in the pom.xml
:
<repositories>
<repository>
<id>openflexo-release</id>
<name>openflexo-release</name>
<url>https://maven.openflexo.org/artifactory/openflexo-release/</url>
</repository>
</repositories>
or to use a SNAPSHOT version
<repositories>
<repository>
<id>openflexo-release</id>
<name>openflexo-release</name>
<url>https://maven.openflexo.org/artifactory/openflexo-deps/</url>
</repository>
</repositories>
Add also the dependency to the pamela-core
artifact (Java 8 required):
<dependency>
<groupId>org.openflexo</groupId>
<artifactId>pamela-core</artifactId>
<version>1.5</version>
</dependency>
or to use a SNAPSHOT version (Java 11 or later required)
<dependency>
<groupId>org.openflexo</groupId>
<artifactId>pamela-core</artifactId>
<version>1.6.1-SNAPSHOT</version>
</dependency>
Important notice : Note that Java 8 (1.8) is required for 1.5 last stable version but Java 11 is required from 1.6.1 version.
1.3. Test PAMELA by building your first model
The best way to understand PAMELA is to build your first model.
Look at the examples (download links) at the end of this webpage, and run examples.
For each example, we can do :
gradle test
and
gradle run
Here are the different versions:
- v1.zip : minimal example
- v2.zip : adding behaviour
- v3.zip : behaviour modifications (AccessibleProxyObject)
- v4.zip : a more complex example
2. Download and build PAMELA framework in your environment
Advanced users : do that only if you want to download PAMELA sources, review the code, run the tests, define your own annotations, implementations, and/or contribute to the project.
Prerequisite
2.1. Download sources
In order to get the most up to date code you can clone and build Pamela yourself.
Prerequisite
Checkout sources
PAMELA framework is hosted on github: https://github.com/openflexo-team/pamela.
Clone PAMELA in your environment:
git clone git@github.com:openflexo-team/pamela.git
2.2 Run tests
Unit tests located in src/test/java in pamela-core are a good starting point to discover the framework (run the tests and analyse the test source code).
All tests are sorted and labelled with an explicit name which help to know which feature is beeing tested.
For example the package org.openflexo.pamela.test.jml
contains unit tests for JML features. BankAccount.java
is the class containing business code to be tested while JMLTests.java
contains the tests themselves. It is really interesting to read and understand both classes to have a good overview and understanding for JML feature.
The package org.openflexo.pamela.test.test1
contains basic unit tests for core features.
2.3 Discover PAMELA main features
- Model at runtime computation, model fragmentation management
- Life-cycle management
- Meta-programming support
- Multiple inheritance and traits programming
- Containment management
- Cloning support
- Clipboard operations
- Notification support
- Persistance support, XML serialization/deserialization
- Equality computing support
- Visiting features
- Differential updating
- Validation API
- Contract programming, JML
- Design patterns, aspect programming
2.4 Reference documentation
The javadoc for Pamela can be found .