PCM Development/Getting Started

Aus SDQ-Wiki
Zur Navigation springen Zur Suche springen

Useful hints on PCM development

Getting Started

This article gives initial information of how to change the PCM Bench implementation (Either develop new features for the PCM, fix bugs or change things).

The two basic option to work with Palladio code as follows:

Working with a PCM Installation

  1. Install the PCM Nightly as described at PCM_Installation#PCM_Nightly
    • the installation instructions are sufficient
    • for development purposes, it is useful to also install the Developer Resources from the update site
  2. Check out projects from Github and import them in Eclipse (only import projects you want to change)
    • Installed Palladio plugins will be used by default
    • Plugins in the Eclipse workspace override installed plugins when open (therefore, you can change and test code)
  3. Some project (e.g. metamodel projects) require the generation of source code before the projects compile within Eclipse
    • Simple way: run the Maven build (e.g. mvn verify) to trigger the code generation
    • Advanced way: look for the appropriate MWE2 workflow (files end with ".mwe2") within the project and run it
  4. Select "Run as Eclipse application"
    • All opened plugin projects will be compiled and integrated in the started Eclipse.
    • Switch to the Java perspective to see the run configuration.

Working with Source Code Only

As an alternative to installing the PCM and some source code (as described at PCM_Installation#PCM_Nightly), you might want to omit the PCM installation and check out the whole source code instead. This is useful if you want to avoid any incompatibilities between installed and checked out PCM plugins, or if you want a full overview over all source code affected by your change. However, you have to also install all dependencies. Proceed as follows:

  1. Install a supported Eclipse (see PCM_Installation#PCM_Nightly for required version)
  2. Install required Eclipse features:
    1. Install everything from a non-Palladio repository that is mentioned in our aggregated update site
    2. TODO: Clarify instructions
  3. Check out the source code from Github
    1. all non-archived repos: curl -s https://api.github.com/orgs/PalladioSimulator/repos?per_page=200 | jq -c '.[] | select( .archived == false).clone_url' | xargs -n 1 git clone
    2. Import the projects via the import feature for existing projects of Eclipse

Notes:

  1. Ensure that your project is configured to UTF-8 file encoding
  2. Ensure using our coding conventions

Creating PCM model elements from code

You can instantiate one of the model factories, and then use this factory to create model elements defined in the meta model. see Example PCM Model Factories for an example project.

  • de.uka.ipd.sdq.pcm.repository.RepositoryFactory (for repositories, components, interfaces, roles)
  • de.uka.ipd.sdq.pcm.resourcetype.ResourcetypeFactory (for abstract resource types, such as processing or communication resources)
  • de.uka.ipd.sdq.pcm.seff.SeffFactory (for resource demanding service effect specifications)
  • de.uka.ipd.sdq.pcm.system.SystemFactory (for system containers)
  • de.uka.ipd.sdq.pcm.usagemodel.UsagemodelFactory (for user behaviour)
  • ...

Code Overview

If you want to find specific PCM plugins, check the PCM_Code_Overview to find our in which folder in the SVN the plugin is located.

Licenses

A list of the used Licenses in PCM.

See also

Background: Eclipse Plugins, Features and Extension Points