code_mobility 1.1.0

  • Readme
  • Changelog
  • Installing
  • 0

Code Mobility #

A library for code mobility with Dart. This library was initially created for my master's thesis. Also, a second library for decision-making, called Adaptify, was developed. For more information on this topic see the blog post on the blog of my employer inovex GmbH.

For information how to use the library in a project see the description on the Pub Repository.

Concepts #

With the Code Mobility library different concepts of code distribution and execution are implemented. In order to demonstrate the opportunities of the library these concepts are briefly discussed here. The easiest way of code distribution is the use of locally available code. In this case, it's assumed that the source code is available on all devices and the code can simply be executed on them. If the task is executed remotely, it may be necessary to send additional data to the target device. After the computation the result is returned from the local or remote device and further processed. These types of executions are referred to as local execution and remote execution.

Another concept is remote evaluation, which is similar to Remote Procedure Call (RPC). It enables the remote execution of code on a target device and the receipt of the result. A simple example for the use of remote evaluation is an SQL query, which is sent to the SQL server and executed there. The result of the query is returned to the sender.

The last supported concept is code on demand. This concept supports requesting source code from another device. On the requesting device, the source code is executed and the results are processed. The best known and widely used example for code on demand is JavaScript in a browser. Figure above shows the different approaches for code mobility.

Code Mobility

Structure #

Based on these concepts the library provides its functionality. The central piece of Code Mobility is the task, whose execution is the reason for all further functionality. A task consist of the three metadata name, resource identifier and description. This metadata are used to uniquely identify the task in the code distribution and execution and to provide additional information. In principle a task consists of a class that manipulates the input data and returns the result or an error. It's executed by a taskrunner on either a server or client. This class is responsible for the handover of the input data, the execution of the task and the evaluation of the return values. In addition to an abstract interface for the taskrunner, the library contributes a concrete implementation for the client and server.

The server is also part of the Code Mobility library and is only available for the Dart VM. A server is used to deliver the content and to accept requests for the above described concepts. For communication and data exchange the HTTP protocol and the JSON data format is used. Code Mobility consists of an abstract server class and two concrete implementations: The MobilityServer, which supports all concepts and the limited RepositoryServer that provides only content delivery.

The client controls the local execution of a task, triggers a remote execution/evaluation or queries the source code with code on demand. In all cases, the client delivers the result to the application for further processing. The client is defined with an abstract class to provide unified interface. Furthermore, the library provides clients for the Dart VM and the browser.

Development #

For feedback and bug reports just open an issue. Feel free to fork this project, create pull request and contact me for any questions.

Documentation #

The features are explained in the dartdoc documentation and the example implementations.

License #

Code Mobility is licensed under the BSD License.

Changelog #

1.0.0 #

  • First public release version with basic features

0.0.1 #

  • Initial version

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:

  code_mobility: ^1.1.0

2. Install it

You can install packages from the command line:

with pub:

$ pub get

Alternatively, your editor might support pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:

import 'package:code_mobility/code_mobility.dart';
Describes how popular the package is relative to other packages. [more]
Code health derived from static analysis. [more]
Reflects how tidy and up-to-date the package is. [more]
Weighted score of the above. [more]
Learn more about scoring.

The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.

Analysis issues and suggestions

Support Dart 2 in pubspec.yaml.

The SDK constraint in pubspec.yaml doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see


Package Constraint Resolved Available
Direct dependencies
Dart SDK >=1.15.0 <2.0.0