Skip to content

DescribeComponent

Thomas Schwotzer edited this page Mar 21, 2023 · 13 revisions

Shark Component Description

Let's start with an example:

@ASAPFormats(formats = {YourComponent.FORMAT_A, YourComponent.FORMAT_B})
public class YourComponent implements SharkComponent, YourFacade {
    public static final String FORMAT_A = "myApp://formatA";
    public static final String FORMAT_B = "myApp://formatB";
    ...
}

You component is described by a a single interface (YourComponent). It must implement SharkComponent and will usually offer another interfaces that describes all specific methods offered by your application (YourFacade). Facade Pattern is really a good thing.

The @ASAPFormats annotation is mandatory. All supported formats must be declared with the formats parameter. That's it. You have successfully declared your ASAP application as SharkComponent.

There is nice side effect. You might be asked what your component can do. Now you have a brief answer: Read my component interface.

Example

SharkPKI project provides a Public Key Infrastrcuture as Shark Component. Its features are explained in a single interfaces: SharkPKIComponent.

Here are a few lines:

@ASAPFormats(formats = {SharkPKIComponent.CREDENTIAL_APP_NAME, SharkPKIComponent.PKI_APP_NAME})
public interface SharkPKIComponent extends SharkComponent, ASAPKeyStore {...}

This component uses two formats and provides a list of methods. It is worth to give it a closer look. It provides all you need for data encryption and certificate exchange.

Next

Now you need to implement a method that allows others to set initialize your component. Your component does not require any initialization process? Good for your. Method implementation will be very easy for you. Nevertheless, there must be anything others can use.

Introduction

Shark Components

  1. Describe your component
  2. Component initialization
  3. Setup Shark App
  4. Component launch

ASAP Hub Management

  1. What's a hub
  2. hub information management
  3. connection management
Clone this wiki locally