Skip to content

Commit 4fbf0c1

Browse files
Update Java Architecture (#628)
* Update Java Architecture * Update java/architecture.md * Update java/architecture.md Co-authored-by: René Jeglinsky <[email protected]> * Update java/architecture.md --------- Co-authored-by: René Jeglinsky <[email protected]>
1 parent ff84e61 commit 4fbf0c1

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

java/architecture.md

+14-10
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,18 @@ status: released
66
uacp: Used as link target from Help Portal at https://help.sap.com/products/BTP/65de2977205c403bbc107264b8eccf4b/9186ed9ab00842e1a31309ff1be38792.html
77
---
88

9-
# Modular Architecture
9+
# Open Architecture
1010
<style scoped>
1111
h1:before {
1212
content: "Java"; display: block; font-size: 60%; margin: 0 0 .2em;
1313
}
1414
</style>
1515

1616
One of the key [CAP design principles](../about/#open-and-opinionated) is to be an opinionated but yet open framework. Giving a clear guidance for cutting-edge technologies on the one hand and still keeping the door wide open for custom choice on the other hand, demands a highly flexible CAP Java SDK.
17-
The [stack architecture](#modular_architecture) reflects this requirement, allowing fine-grained [stack configuration](#stack_configuration) and custom extensions.
17+
Section [Architecture Overview](#modular_architecture) explains how the basic architecture of CAP Java meets this requirement, allowing a fine-grained stack [Configuration](#stack_configuration) and extensions with custom modules.
1818

1919

20-
## Stack Architecture { #modular_architecture}
21-
22-
### Overview
20+
## Architecture Overview { #modular_architecture}
2321

2422
One of the basic design principle of the CAP Java SDK is to keep orthogonal functionality separated in independent components. The obvious advantage of this decoupling is that it makes concrete components exchangeable independently.
2523
Hence, it reduces the risk of expensive adaptions in custom code, which can be necessary due to new requirements with regards to the platform environment or used version of platform services. Hence, the application is [platform **and** service agnostic](../about/#agnostic-approach).
@@ -60,7 +58,6 @@ As all other components in the different layers of the CAP Java SDK are decouple
6058

6159
### Protocol Adapters { #protocol-adapters}
6260

63-
6461
The CAP runtime is based on an [event](../about/#events) driven approach. Generally, [Service](../about/#services) providers are the consumers of events, that means, they do the actual processing of events in [handlers](../guides/providing-services#event-handlers). During execution, services can send events to other service providers and consume the results. The native query language in CAP is [CQN](../cds/cqn), which is accepted by all services that deal with data query and manipulation. Inbound requests therefore need to be mapped to corresponding CQN events, which are sent to an accepting Application Service (see concept [details](../about/#querying)) afterwards. Mapping the ingress protocol to CQN essentially summarizes the task of protocol adapters depicted in the diagram. Most prominent example is the [OData V4](https://www.odata.org/documentation/) protocol adapter, which is fully supported by the CAP Java SDK. Further HTTP-based protocols can be added in future, but often applications require specific protocols, most notably [RESTful](https://en.wikipedia.org/wiki/Representational_state_transfer) ones. Such application-specific protocols can easily be implemented by means of Spring RestControllers.
6562

6663
The modular architecture allows to add custom protocol adapters in a convenient manner, which can be plugged into the stack at runtime. Note that different endpoints can be served by different protocol adapters at the same time.
@@ -84,9 +81,9 @@ The overall architecture of the CAP Java SDK allows additional components to be
8481

8582
CAP Java makes use of [features](#standard-modules) itself to provide optional functionality, examples are [SAP Event Mesh](./messaging-foundation) and [Audit logging](./auditlog) integration.
8683

87-
## Stack Configuration { #stack_configuration}
84+
## Configuration { #stack_configuration}
8885

89-
As outlined in section [Modular Architecture](#modular_architecture), the CAP Java SDK is highly flexible. You can choose among modules prepared for different environments and in addition also include optional or custom extensions.
86+
As outlined in section [Architecture Overview](#modular_architecture), the CAP Java SDK is highly flexible. You can choose among modules prepared for different environments and in addition also include optional or custom extensions.
9087
Which set of modules is active at runtime is a matter of compile time and runtime configuration.
9188

9289
At compile time, you can assemble modules from the different layers:
@@ -95,7 +92,7 @@ CAP Java makes use of [features](#standard-modules) itself to provide optional f
9592
* The core [service providers](#service-providers)
9693
* [Application features](#application-features) to optionally extend the application or adapt to a specific environment
9794

98-
### Module Configuration
95+
### Wiring Modules { #module-configuration }
9996

10097
All CAP Java SDK modules are built as [Maven](https://maven.apache.org/) artifacts and are available on [Apache Maven Central Repository](https://search.maven.org/search?q=com.sap.cds). They've `groupId` `com.sap.cds`.
10198
Beside the Java libraries (Jars) reflecting the modularized functionality, the group also contains a "bill of materials" (BOM) pom named `cds-services-bom`, which is recommended especially for multi-project builds. It basically helps to control the dependency versions of the artifacts and should be declared in dependency management of the parent `pom`:
@@ -186,7 +183,7 @@ Additional application features you want to use are added as additional dependen
186183
Choosing a feature by adding the Maven dependency *at compile time* enables the application to make use of the feature *at runtime*. If a chosen feature misses the required environment at runtime, the feature won't be activated. Together with the fact that all features have a built-in default implementation ready for local usage, you can run the application locally with the same set of dependencies as for productive mode.
187184
For instance, the authentication feature `cds-feature-hana` requires a valid `hana` binding in the environment. Hence, during local development without this binding, this feature gets deactivated and the stack falls back to default feature adapted for SQLite.
188185

189-
### CAP Java Standard Modules { #standard-modules }
186+
### Standard Modules { #standard-modules }
190187

191188
CAP Java comes with a rich set of prepared modules in all different layers of the stack:
192189

@@ -248,3 +245,10 @@ An example of a CAP application with OData V4 on Cloud Foundry environment:
248245
</dependency>
249246
</dependencies>
250247
```
248+
249+
### Custom Modules { #custom-modules }
250+
251+
The plugin technique for the [standard modules](#standard-modules) can be used for custom modules in the same way.
252+
By adding an additional dependency in the application project to the custom Maven module, the loaded module automatically adds functionality (usually handlers or providers) or extensions to the CDS model.
253+
254+
[Learn more about the CAP Java plugin technique.](../java/plugins){ .learn-more}

0 commit comments

Comments
 (0)