|
| 1 | +# High Level Design |
| 2 | + |
| 3 | +This High Level Design defines the Java Tech Adapter Framework design, a Spring Boot based framework to streamline the experience of creating Witboost tech adapters by standardizing common features, namely the API layer, descriptor parsing, base configuration, etc. This also allows to introduce new features and fix issues faster and without the need to propagate the feature or fix to all developed Java tech adapters. |
| 4 | + |
| 5 | +The base for this Framework will follow the existing [Java scaffold](https://github.com/agile-lab-dev/witboost-java-scaffold), and will take most of the implementation as-is, improving the existing base features to allow complete use of the potential of Witboost tech adapters. |
| 6 | + |
| 7 | +At a high level, the features this framework should provide are: |
| 8 | + |
| 9 | +- Support for the whole Tech Adapter OpenAPI specification v2.2.0 at API level with plans to update to newer versions of the API (current version as of 01/08/2024 is 2.6.0). |
| 10 | +- Implement the API layer of a typical Java Tech Adapter, including appropriate error handling with support for the full error schema |
| 11 | +- Provide extension points to define provisioning and validation business logic with a well-defined interface. |
| 12 | +- Support to both component level and data product level provisioning. |
| 13 | +- Descriptor parsing and the possibility to configure the expected component `specific` schema for component level operations. |
| 14 | + - Possibility to configure the request `params` schema for ReverseProvisioning requests |
| 15 | + |
| 16 | +Parsing the input to the framework model, and validating said input will be decoupled operations, allowing the framework to handle all possible parsing errors, and providing an interface to validate the parsed input against the specific environment or technology for which the Tech Adapter is developed. |
| 17 | + |
| 18 | +Thus, the interface must provide all the necessary information that the business logic may need to perform all its operations. This includes the following items, but more may be necessary: |
| 19 | + |
| 20 | +- Complete parsed descriptor/request, including data product information |
| 21 | + - Requests must contain all possible fields as per the specification. Optional fields should be marked accordingly |
| 22 | +- For component level provisioning: Component to provision parsed with the appropriate schema |
| 23 | + - Other components not to be provisioned are also correctly parsed as JSON but not decoded as a class |
| 24 | +- For validation operation: As this task is executed during different operations, the type of Operation being performed |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | +## Spring Boot |
| 29 | +We will continue to use Spring Boot as the underlying API framework and leveraging the Spring facilities to achieve the wiring between the framework API layer and the business logic by using Spring's Dependency Injection. |
| 30 | + |
| 31 | +We may provide default behaviour on the interfaces which return Not Implemented errors for each method. |
| 32 | + |
| 33 | +## Sync/async operations |
| 34 | +The framework must support both synchronous and asynchronous operations. This should be handled via configuration, and its implementation should be transparent to the tech adapter implementation, which will only implement the (sync) business logic interface. The asynchronous pool handling shall be done by the framework. The configuration shall provide: |
| 35 | + |
| 36 | +- Enable/disable async provisioning |
| 37 | +- The implementation type of the repository, following WIT-229 design. As a first implementation, only the Cache (in-memory) strategy will be implemented |
| 38 | + |
| 39 | +## OpenTelemetry |
| 40 | +Currently, we provide integration with OpenTelemetry as part of the Java Scaffold project. This integration should remain at the Java scaffold level, as not to impose this tool onto the framework users. Thus, an OpenTelemetry dependency should not be present on the framework. |
| 41 | + |
| 42 | +## Java Scaffold |
| 43 | +The Java Scaffold should be rewritten to remove the API layer and instead including the framework as a dependency, injecting the business logic by implementing the necessary interfaces. |
| 44 | + |
| 45 | +The scaffold will still contain artifacts like the Dockerfile, Helm chart, documentation, and of course, the business logic. |
| 46 | + |
| 47 | +### Helm |
| 48 | +Explore the possibility to have a base chart that could be used as-is or extended for each provisioner, so that we also deduplicate the several charts we have. |
| 49 | + |
| 50 | +## Migration |
| 51 | +The idea of creating the framework is not only to facilitate the creation of future tech adapters, but also to migrate the existing Java and Scala tech adapters to use it and standardize all of our repositories. The migration should be performed only when the framework can support all the tech adapter features that a certain adapter implementation uses. |
| 52 | + |
| 53 | +For example, the Databricks Tech Adapter uses asynchronous operations, so unless the frameworks supports them, it cannot be migrated as we must avoid missing existing features when migrating. |
| 54 | + |
| 55 | +There are other instances, like the ADLS Gen2 Output Port Tech Adapter which slightly modifies the ValidationService interfaces provided by the scaffold to account for the use case it solves. Because of this is necessary to analyze the existing implementations to support them on the framework, else it would be of no use for said tech adapter. |
| 56 | + |
| 57 | +For this purpose, we must provide a sensible guide on how to migrate existing Java and Scala tech adapters to use this framework. |
0 commit comments