Getting started with AgGateway's ADAPT Application Note

This page documents the important concepts related to writing code that utilizes AgGateway's ADAPT Application Data Model. This application note is written from a developer's perspective and is part of the ADAPT minimum viable product (MVP).

Assumptions

  • AgGateway's ADAPT allows disparate applications – the Farm Management Information System (FMIS) - the ability to share similar data elements. This is done by populating the data model from a proprietary data store into the data model, serializing that data model, and passing it to another application where it is de-serialized and translated into that application's data store.
  • ADAPT includes the following:
    • ADAPT Data Model (ADM)
    • ISOXML Plugin - handles data of the ISO 11783 part 10 specification
    • ADM Plugin - serializes/de-serializes a filled ADAPT data model to/from the file system
  • The Data Model UML and the ISOXML Plugin code may not be in sync perfectly. The UML can be considered as a future state while the code is catching up.
  • "Plugins" are code objects that implement the plugin interface and are responsible for importing and exporting the contents of a data model. Generally, the import process de-serializes the stored information into the data model and then translates it into the application's proprietary data store. Conversely, in the export process the plugin generally reads information from a proprietary source, loads it into the data model and then serializes that data model.
  • Plugin objects can be discovered and loaded at run time via the plugin manager.
  • Plugin objects are licensed and distributed by the companies that create them. The licensed objects may be open source and freely distributed, or be fee-based; each authoring company makes this decision at their sole discretion.
  • ADAPT has been developed under the Eclipse Public License v1.0.
  • The code associated with the Application Data Model is written in C# and currently supported by .Net Framework 4.5.1. The Application Data Model itself, however, simply defines a common data structure and therefore could conceivably be used within a variety of languages.

Resources Available

AgGateway has posted resources on AdaptFramework.org to help you get started. They include:

  • Data Model documentation, see ADAPT Overview
  • Code for the model, plugins, and samples, see ADAPT GitHub links below
  • Videos about ADAPT
  • Other application notes like this one

AgGateway holds frequent ADAPT technical meetings. Consider attending or ask questions by email at ADAPT.feedback@aggateway.org.

Getting Started

Step 1. Getting the ADAPT code and Application Data Model


The application data model and related code is available from two separate sources: NuGet packages and GitHub repositories.

When creating an application in Microsoft's Visual Studio or another environment that supports NuGet packages, the NuGet packages provide the most convenient method of acquiring and referencing the necessary assemblies and dependencies. To insert the appropriate NuGet package, search for "AgGateway ADAPT" in the NuGet Package Manager.

The data model and related code can also be retrieved from the following GitHub repositories:

Step 2. Determine how you will use ADAPT


AgGateway's ADAPT Application Data Model can be used by many applications in many different ways. Consider how you will be using ADAPT within your application to better understand how to begin, and which parts of ADAPT apply to that situation.

  • If you are an equipment manufacturer and will use ADAPT to interface with your Mobile Implement Control System (MICS),you may want to develop a plugin. This would allow other applications to populate an instance of a data model and to use your plugin to move that data into and out of your controllers. The ISO v4Plugin will give you a good starting point, or if your MICS supports ISO standards, the ISO plugin may already cover most of your needs.
  • If you are a developer supporting a Farm Management Information System (FMIS) and want to give other third party developers the opportunity to interface with your application via ADAPT, you may also want to develop and distribute a plugin. The ADM Plugin available through NuGet or GitHub will likely provide a good starting point.
  • If you are a developer supporting an FMIS application and wish to provide a way to import and export your application's data using ADAPT, consider using the ADM Plugin within your application. If the information will be received as a serialized data model, the ADM Plugin will de-serialize it and make the data available through an instance of the model. If your application has access to an MICS, you may want to use a plugin for that controller to populate the data model and make it available to your application. 

Step 3. Review existing code


The source code for the ISO v4Plugin and the ADM Plugin are both available on GitHub. The code in these projects should provide meaningful guidance for anyone developing a plugin for consumption by other applications.

FMIS developers should also consider reviewing the sample code projects available on GitHub. The TreeDemo project demonstrates how an application might create, populate and serialize a data model with Grower, Farm, Field, and CropZone information. The ActiveCropZones project demonstrates how the TreeDemo serialized model can be imported into a data model and then queried to retrieve the desired information.

Step 4. Don't be afraid to ask questions

AgGateway's ADAPT Technical Team welcomes questions and feedback via email at ADAPT.feedback@aggateway.org. And this team meets regularly.

AgGateway's ADAPT Application Data Model

AgGateway's ADAPT Application Data Model is simply a vehicle to allow data transmission between an FMIS (and its proprietary data) and another FMIS or an MICS and its data.

Key concepts to understand the ADAPT data model include:

  • When referencing Core Document elements by CompoundIdentifier Id values, those Id values are only valid within the particular instance of an application data model.
  • Specific unique ids are maintained as a collection of UniqueId classes within the CompoundIdentifier.

Plugins

A plugin is the code that understands the proprietary data and also the ADAPT data model. A plugin can either read proprietary data and create ADAPT data or read ADAPT data and populate proprietary data. Getting started with ADAPT means that you will either use an existing ADAPT plugin or create a new plugin for a given format.

It's easy to use ADAPT code within a Visual Studio project by taking advantage of the available NuGet packages.

Keys to a Successful Implementation

1. Know your data.

  • Get a clear picture of how your own data is structured and what your business objects look like.
  • Map your objects to those in the ADAPT model. This doesn't have to be difficult and may not require writing any code initially. The goal is to map each of your objects and their properties to the corresponding ADAPT objects and properties.
  • Knowing your data is probably the single most important step for a smooth integration with ADAPT.

2. DON'T PANIC if there is not an obvious place for each of your data objects.

  • ADAPT is meant to be a lightweight, international vocabulary for expressing agricultural data.
  • Most ADAPT objects contain a set of universally common properties and a place to put geo-political context-dependent attributes (ContextItems).
  • An important question to always ask is, "Does this really need to go into ADAPT?" Since ADAPT is likely being used as an intermediate step to convert to another format, make sure that you are only moving to ADAPT what is required.

3. Communicate with ADAPT community and AgGateway's ADAPT Technical Committee.

  • Constructive feedback is always helpful and contributions are welcome. Please use adapt.feedback@aggateway.org.
  • AgGateway regularly holds ADAPT Technical Committee meetings. This is a great forum to learn more and to contribute.

Questions?

Email us at: 

Adapt.Feedback@AgGateway.org 

For more information, including materials for joining ADAPT, visit: http://www.AdaptFramework.org

AgGateway Wiki

ADAPT Wiki

You must be a member to access some areas of the Wiki. Contact Member Services at Member.Services@AgGateway.org for more information.

Chair
Mark Stelford, Premier Crop

Vice-Chair
Dan Danford, CNH

Coming Soon