InterAppConnector 0.4.0

dotnet add package InterAppConnector --version 0.4.0
NuGet\Install-Package InterAppConnector -Version 0.4.0
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="InterAppConnector" Version="0.4.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add InterAppConnector --version 0.4.0
#r "nuget: InterAppConnector, 0.4.0"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install InterAppConnector as a Cake Addin
#addin nuget:?package=InterAppConnector&version=0.4.0

// Install InterAppConnector as a Cake Tool
#tool nuget:?package=InterAppConnector&version=0.4.0

Coverage Maintainability Rating Security Rating Reliability Rating

Vulnerabilities Bugs

InterAppConnector

InterAppConnector is a library that helps to create modules that can be easily integrated in different applications and project types by using a common message format.

It is very useful for software or applications that are developed using the modular programming and in particular the module pattern.

You can create one or more modules (called commands) and call them in the same mode without worrying about the project type

Features

  • Easy integration and out-of-box experience with console applications
  • Integration with web applications, automated and non-interactive procedures (such as batch, jobs, automated tasks, ...) and other project types
  • Argument definition in classes. You can define mandatory and optional arguments that are checked before the command starts
  • Extensible
  • Support for obfuscated code (in preview)

Quick example

  1. Create a class for parameters and name it SampleArgument. Add a string property called Name

     public class SampleArgument
     {
     	public string Name {get; set;} = string.Empty;
     }
    
  2. Create a class for command and name it SampleCommand

    1. Add a Command attribute and implement ICommand<SampleArgument> interface

    2. In Main method write your business logic code

       [Command("hello", Description = "A simple hello command")]
       public class SampleCommand : ICommand<SampleArgument>
       {
       	public string Main(SampleArgument command)
       	{
       		return CommandOutput.Ok("Hello, " + command.Name);
       	}
       }
      
  3. Depending on your project type:

    • In a console application, add in your Program.cs file in Main(string[] args) this code

        CommandManager command = new CommandManager();
        command.AddCommand<SampleCommand, SampleArgument>();
      
        InterAppCommunication connector = new InterAppCommunication(command);
        connector.ExecuteAsInteractiveCLI(args);
      
    • In other applications:

      • Parameters must be defined in a dynamic object where the name of the properties are the name of the arguments

      • Replace ExecuteAsInteractiveCLI(string[]) method of the example above with ExecuteAsBatch(string, dynamic) method

          dynamic arguments = new ExpandoObject();
          arguments.Name = "John";
        
          CommandManager command = new CommandManager();
          command.AddCommand<SampleCommand, SampleArgument>();
        
          InterAppCommunication connector = new InterAppCommunication(command);
          CommandResult<SampleArgument> result = connector.ExecuteAsBatch<SampleArgument>("hello", arguments);
        
  4. Build the project if you have created a console application, otherwise go to step 5

  5. In order to get the result

    • If you are creating a console application, open the Command Prompt in Windows or Bash in Linux and type the command below (it is assumed that the project name is called SampleProgram)

        SampleProgram.exe hello -name John
      

      You will see a green message with the date and time in current datetime format, the message status followed by the success code and the message Hello, John. A typical execution of the program generate the following output:

      [11/10/2023 23:50:34] SUCCESS (0): Hello, John

    • In other applications, use the object returned by the ExecuteAsBatch<ArgumentType> method.

Documentation and code examples

For advanced scenarios and in order to learn how to use the library efficiently, see the documentation provided with the library. Below you will find informations about how to find this documentation

General documentation

The general documentation is available in the GitHub Wiki section.

Code examples

The InterAppConnector sample code repository contains code examples that shows how to use the library

Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 is compatible.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • net6.0

    • No dependencies.
  • net7.0

    • No dependencies.
  • net8.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.4.0 149 1/10/2024
0.3.0 140 12/15/2023
0.2.0 114 12/10/2023
0.1.0 132 12/2/2023