You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Create or upload the data model and prepare environment
30
30
31
31
32
-
1. To create a cached service with MBT, you can either upload an existing metadata file or you can use the graphical tools in SAP Business Application Studio to start from scratch.
32
+
1. To create a cached service with MBT, you should start with an metadata XML file that you can further edit in XML editor.
33
33
34
34
- For this tutorial please continue editing or copy the MBT project from [Create a simple OData Service with Mobile Back-End Tools](cp-mobile-backend-tools-simple-odata) mentioned in prerequisites. This is not only about the metadata, but also about service instance creation and binding which are not repeated within this tutorial.
- This tutorial assumes that you completed the tutorial [Connect SAP Cloud Platform to Your SAP Gateway Demo System Account (ES5)](cp-portal-cloud-foundry-gateway-connection) where you registered for an ES5 user and learned how to manage an SAP BTP destination. You can alternatively rename your existing `ES5` destination and append the OData service's sub-path ``/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/``to the URL of the destination.
56
+
- This tutorial assumes that you completed the tutorial [Connect SAP BTP to Your SAP Gateway Demo System Account (ES5)](cp-portal-cloud-foundry-gateway-connection) where you registered for an ES5 user and learned how to manage an SAP BTP destination. You can alternatively rename your existing `ES5` destination and append the OData service's sub-path ``/sap/opu/odata/IWBEP/GWSAMPLE_BASIC/``to the URL of the destination.
57
57
58
58
3. Back in SAP Business Application Studio, to allow consumption of the destination in your application, add a service instance of type destination to your application's `mtad.yaml`.
# Understand Full-Stack Development with Mobile Back-End Tools
12
15
<!-- description --> Understand how SAP Mobile Services Mobile Back-End Tools (MBT) can solve common mobile offline challenges.
13
16
14
17
## Prerequisites
15
-
- It might be helpful to know the [Basic concepts of OData protocol](odata-01-intro-origins) for better understanding of the topic.
18
+
- It might be helpful to know the [Basic concepts of OData protocol](odata-01-intro-origins) for better understanding of the topic.
16
19
17
20
## You will learn
18
-
- Why you might want to use Mobile Back-End Tools
19
-
- What is the relation between OData and the database
20
-
- Why you might want to cache data for a mobile use case
21
-
- How client registrations and filters can solve some common mobile offline challenges
22
-
23
-
---
24
-
25
-
### Introduction to Mobile Back-End Tools
26
-
21
+
- Why you might want to use Mobile Back-End Tools
22
+
- What is the relation between OData and the database
23
+
- Why you might want to cache data for a mobile use case
24
+
- How client registrations and filters can solve some common mobile offline challenges
27
25
26
+
## Intro
28
27
In essence, MBT is a set of tools that allow you to generate a full featured OData web service without writing a line of code. The tools are designed to transparently convert OData models into a persistence and offer transparent OData functionality including delta calculations out of the box.
29
28
30
29
Beyond that over-simplification, MBT, as a feature of SAP Mobile Services, is a set of tools that have the target of solving several challenges which may arise in mobile application's synchronisation for offline capabilities.
@@ -33,85 +32,66 @@ Therefore they offer (optional) features, e.g. targeting integration (as a cache
33
32
34
33
MBT is available as a [Marketplace extension](https://marketplace.visualstudio.com/items?itemName=SAPSE.vsc-extension-mbt) for Visual Studio Code or as part of SAP Business Application Studio in the preset for *"SAP Mobile Application"*.
35
34
36
-
37
-
38
35
### What you will build
39
-
40
-
41
36
This tutorial and it's mission will give you an introduction to possible usage of Mobile Back-end Tools [Cache Databases](https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/guides/getting-started/mbt/cache-databases.html). It is intended to give a simplified scenario with technical introduction of the technology while keeping requirements also available to trial users.
42
37
43
38
You can run so-generated OData services in SAP Business Technology Platform (BTP) or on Premise (on Apache Tomcat, TomEE or Eclipse Virgo).
44
39
45
-
- If you plan to run the generated service in SAP BTP
40
+
- If you plan to run the generated service in SAP BTP
46
41
47
-
- SAP Business Application Studio will be better choice for most developers as it allows you to leverage the same environment during design time and run time.
42
+
- SAP Business Application Studio will be better choice for most developers as it allows you to leverage the same environment during design time and run time.
48
43
49
-
- The CSDL graphical modeler is only available in SAP Business Application Studio.
44
+
- SAP Business Application Studio as a cloud solution will run out of the box with the preset for *SAP Mobile Services* and does not require a manual setup of your development environment as well as being OS agnostic
50
45
51
-
- SAP Business Application Studio as a cloud solution will run out of the box with the preset for *SAP Mobile Services* and does not require a manual setup of your development environment as well as being OS agnostic
46
+
- If you plan to run the generated service in an on premise architecture
52
47
53
-
-If you plan to run the generated service in an onpremise architecture
48
+
-You can still connect it via SAP Cloud Connector to SAP Mobile Services, but you might want to generate and develop the service in an on-premise architecture leveraging the Visual Studio Code extension for mobile back-end tools
54
49
55
-
- You can still connect it via SAP Cloud Connector to SAP Mobile Services, but you might want to generate and develop the service in an on-premise architecture leveraging the Visual Studio Code extension for mobile back-end tools
56
-
57
-
- For Visual Studio Code you need to [setup your own environment locally](https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/guides/getting-started/mbt/setup.html#visual-studio-code-extension)
50
+
- For Visual Studio Code you need to [setup your own environment locally](https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/guides/getting-started/mbt/setup.html#visual-studio-code-extension)
58
51
59
52
The following diagram depicts an exemplary architecture for an MBT-based service in mobile solution context:
>In this tutorial's mission, the target system is connected as a publicly available HTTP destination. In a real-world scenario, you might connect your system in a similar way if it is a cloud system or via SAP Cloud Connector if it is an on premise system.
63
56
64
-
65
-
66
57
### Role of CSDL and database
67
-
68
-
69
58
OData's declarative way of defining the model as well as operations works in a way that allows a mapping between OData operations and operations on an actual database.
70
59
71
-
Therefore, usually MBT's central starting point is the metadata file, respectively Common Schema Definition Language (CSDL) document. In SAP Business Application Studio, MBT can leverage the CSDL graphical modeler to simplify working with OData models.
60
+
Therefore, usually MBT's central starting point is the xml-based metadata file, respectively Common Schema Definition Language (CSDL) document.
72
61
73
62
On the one hand, MBT provides runnable tasks that generate a database persistence or persistence descriptor (SQL), reflecting the whole OData model. On the other hand, MBT can build a transparent OData service [based on existing database tables](https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/guides/getting-started/mbt/existing-tables.html).
74
63
75
64
Different database types are supported depending on the runtime. Following databases may e.g. be used with the tools in certain environments (Derby and H2 only for testing, please refer to [documentation](https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/guides/getting-started/mbt/service-generator.html#option-bind-db-typedb-name) and/or Product Availability Matrix for official support statements):
76
65
77
-
- SAP ASE
78
-
79
-
- Apache Derby
66
+
- SAP ASE
80
67
81
-
- H2 database
68
+
- Apache Derby
82
69
83
-
- SAP HANA
70
+
- H2 database
84
71
85
-
- Azure SQL or Microsoft SQL Server
72
+
- SAP HANA
86
73
87
-
- Oracle Database
74
+
- Azure SQL or Microsoft SQL Server
88
75
89
-
- PostgreSQL
76
+
- Oracle Database
90
77
91
-
- SAP SQL Anywhere
78
+
- PostgreSQL
92
79
80
+
- SAP SQL Anywhere
93
81
94
82
### Benefit of caching mobile app data
95
-
96
-
97
83
Most of the applications built in an enterprise environment are not a stand-alone use case but must be integrated into existing ecosystems, data and business processes. Therefore, MBT offers to link and map operations on your OData service to operations on another interface.
98
84
99
85
Typically, when developing a new Mobile App, you have to choose a technology as best-fit for your architecture. You can therefore build new services on the source system, replicate data to another system or cache relevant parts of your data for easy-to-use mobile consumption.
100
86
101
87
This may come in handy if you want to build a service on top of legacy interfaces, if you want to decrease load on the referenced system or if you want to add more efficient delta capabilities for better user experience of your client apps without modifying the back-end interface.
102
88
103
-
104
89
### Benefit of client registrations
105
-
106
-
107
90
In MBT, [Client Registrations](https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/guides/getting-started/mbt/client-registrations.html), beyond the user identity, reflect one specific offline data store. This identification allows precise change determination beyond timestamp-based calculation, especially in combination with client filters.
108
91
109
92
A client registration requires the service to contain an entity on which an offline store registers with a `uuid`. This ID must be sent with any upcoming user request in the HTTP-header `Client-Instance-ID`.
110
93
111
-
112
94
### What is a Client Filter?
113
-
114
-
115
95
Many use cases shall allow the user to select what data can be downloaded into the client database.
116
96
117
97
This can e.g. be geographical, organisational or historical requirements. MBT therefore allows `ClientFilter`-annotated entities that are supposed to be leveraged in [custom download queries](https://help.sap.com/doc/f53c64b93e5140918d676b927a3cd65b/Cloud/en-US/docs-en/guides/getting-started/mbt/change-tracking.html#download-queries-using-filter-entities) for a specific offline store.
@@ -120,11 +100,6 @@ After registering to the service, clients can therefore upload one or more entit
120
100
121
101
Example:
122
102
123
-
- A sales representative working in one specific area on a specific day could upload a filter to only retrieve customer data with sales orders for customers in that specific area within the last two years.
124
-
125
-
126
-
---
103
+
- A sales representative working in one specific area on a specific day could upload a filter to only retrieve customer data with sales orders for customers in that specific area within the last two years.
127
104
128
105
**Congratulations!** You have now learned about some of the features MBT offers, so you can proceed to try them out in this mission's further tutorials.
0 commit comments