Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APP-3082 Architecture Presentation #258

Merged
merged 10 commits into from
Oct 5, 2020
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ New feature requests on the legacy SDK will not be accepted.
This repository contains both the legacy Java SDK under the [symphony-bdk-legacy module](symphony-bdk-legacy)
and the BDK2.0 under all other root modules.
Please check the [legacy module readme file](symphony-bdk-legacy/README.md) and the
[BDK2.0 architecture file](docs/internal/bdk-architecture.md) for more information.
[BDK architecture](docs/tech/architecture.md) documentation for more information.

## Testing

Expand Down
18 changes: 0 additions & 18 deletions docs/internal/bdk-architecture.md

This file was deleted.

3 changes: 3 additions & 0 deletions docs/spring-boot/core-starter.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,3 +252,6 @@ public class GifFormActivity extends FormReplyActivity<FormReplyContext> {
}
}
```

----
[Home :house:](../index.md)
46 changes: 46 additions & 0 deletions docs/tech/architecture.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
# BDK Architecture Presentation
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we link to this document from the index of the documentation?

The Symphony BDK for Java is a multi-module library that uses [Gradle](https://gradle.org/) as build system.
This page will help to clearly understand how the library has been designed. This can be also useful for new contributors
aiming to provide additional features or implementations or existing APIs.

## Architecture Overview
The following diagram aims to give an overview of the different layers and modules provided by the BDK library.
![Architecture Overview Diagram](architecture.svg)

### symphony-bdk-core
The `symphony-bdk-core` is the main module that allows developers to write bots from a pure Java main application. It contains
all necessary BDK features such as:
- [configuration](../configuration.md)
- [authentication](../authentication.md)
- [datafeed](../datafeed.md)
- [services](../message.md)
- [activity API](../activity-api.md)

#### Code Generation
The `symphony-bdk-core` module relies on the [openapi-generator-maven-plugin](https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator-maven-plugin/README.md)
to generate API clients and models from official Symphony's [Swagger specifications](https://github.com/symphonyoss/symphony-api-spec).
API's clients are located under package `com.symphony.bdk.gen.api` and models under `com.symphony.bdk.gen.api.model`.

### symphony-bdk-http
The `symphony-bdk-http-api` module defines a generic interface for performing HTTP calls. Along with this interface, it
also provides a utility `com.symphony.bdk.http.api.HttpClient` class helping developers to perform calls to external systems.
> :warning: It is important to notice that interface `com.symphony.bdk.http.api.ApiClient` is used by generated code.
> Changing contract would break the build. See [Code Generation](#code-generation).

At the moment, two different implementations have been created for the `com.symphony.bdk.http.api.ApiClient` interface:
- `com.symphony.bdk.http.jersey2.ApiClientJersey2` contained in module `symphony-bdk-http-jersey2` (default implementation for [Core](#symphony-bdk-core))
- `com.symphony.bdk.http.webclient.ApiClientWebClient` contained in module `symphony-bdk-http-webclient` (default implementation for [Spring Boot](#symphony-bdk-spring))

### symphony-bdk-template
The `symphony-bdk-template-api` module defines a set of interfaces that allows developers to load and fill text files with
data. This API is especially useful for complex MessageML templating.

At the moment, two different module implementations have been created:
- `symphony-bdk-template-freemarker`
- `symphony-bdk-template-handlebars`

### symphony-bdk-spring
The Symphony BDK comes also with two _starter_ modules to ease integration with the Spring Boot framework:
- `symphony-bdk-core-spring-boot-starter` that is basically a wrapper around the [symphony-bdk-core](#symphony-bdk-core) module
- `symphony-bdk-app-spring-boot-starter` that is a foundation for [Extension Applications](https://developers.symphony.com/symphony-developer/docs/overview-of-extension-applications)
backend development
1 change: 1 addition & 0 deletions docs/tech/architecture.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion symphony-bdk-http/symphony-bdk-http-api/build.gradle
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
description = 'Symphony Java BDK Core Http API'

dependencies {

compileOnly 'org.projectlombok:lombok'
annotationProcessor 'org.projectlombok:lombok'

implementation 'org.apiguardian:apiguardian-api'
implementation 'org.glassfish.jersey.core:jersey-client'
}

Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
package com.symphony.bdk.http.api;

import com.symphony.bdk.http.api.util.TypeReference;

import lombok.Getter;
import org.apiguardian.api.API;

import java.net.HttpURLConnection;
import java.util.List;
import java.util.Map;

import javax.ws.rs.core.GenericType;

/**
* Main exception raised when invoking {@link ApiClient#invokeAPI(String, String, List, Object, Map, Map, Map, String, String, String[], GenericType)}.
* Main exception raised when invoking {@link ApiClient#invokeAPI(String, String, List, Object, Map, Map, Map, String, String, String[], TypeReference)}.
*
* Initially generated by the OpenAPI Maven Generator
*/
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/**
* This module provides contract for performing HTTP calls.
*
* <p>
* <b>WARNING</b>: The interface {@link com.symphony.bdk.http.api.ApiClient} is used by generated code.
* Changing the contract will break code generation.
* </p>
*/
package com.symphony.bdk.http.api;