Skip to content

Commit

Permalink
APP-3082 Architecture Overview (finos#258)
Browse files Browse the repository at this point in the history
* APP-3082 SVG Rendering in Markdown test

* APP-3082 Updated diagram

* APP-3082 Removed unused Jersey dependency

* APP-3082 WIP

* APP-3110 arch doc

* APP-3110 removed unused javax.ws.rs.core.GenericType import from ApiException class

* APP-3082 fixes

* APP-3082 Link to Architecture Presentation from ./docs/index.md
  • Loading branch information
thibauult authored Oct 5, 2020
1 parent f5c7df0 commit 0fa637b
Show file tree
Hide file tree
Showing 9 changed files with 66 additions and 23 deletions.
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
2 changes: 2 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,5 @@ The reference documentation consists of the following sections:
Getting Started guides are also available for Spring Boot:
- [Core Starter](./spring-boot/core-starter.md)

### Technical Documentation
You can find an overview of the BDK Architecture [here](./tech/architecture.md).
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
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;

0 comments on commit 0fa637b

Please sign in to comment.