Portus Version 2012-12-17
 —  Administration  —

Portus BusinessDataViews

Portus enables physical assets (tables, files, etc.) to be exposed as "atomic" WebServices, which is useful when direct access to these resources is required. However, it is often the case that a single physical table or file does not represent an object that is of use in a business sense. A typical business function will generally consist of data from more than one physical file/table/...

For this purpose, Portus introduces the concept of Business Data Views (BDVs). This will enable the building of "compound" services around logical views of data, combining the relevant elements from the underlying physical assets. This way WebServices can be created to list, add, update, delete, get and select objects that will represent data in a business sense as against the physical view.


Overview / Concepts

All businesses have enormous amounts of data which is exposed via various interfaces and applications, however, rarely, if ever, does one application, one database table or one file represent a complete piece of business related data. The reason for this is straightforward in that most IT projects tend to focus on the ‘data model’ and the efficiency of getting at data as the primary driver when designing such systems. This is still core to system design today to ensure that the physical architecture can handle the loads anticipated for a given system. However, it generally means that new projects must deal with data models that are sometimes hard to understand from a business perspective. Portus technology now offers the ability to map the existing data and business logic assets into composite views that reflect the business view of the data. This means that newer projects can deal with business related concepts and objects when viewing or updating the core assets.

A Simple Example

Taking a very simple example where an organization has two tables or files containing information about the owner of a vehicle and the vehicle details itself. Assume the data model here is as follows:

  1. The Owner Table or File (The "Personnel" File)

    Note:
    This contains details about the owners of a vehicle. For the purposes of this illustration, we will assume the following fields:

  2. The Vehicle Table or File

    Note:
    This will contain details about the vehicles that are owned by owners. For the purposes of this illustration, we will assume the following fields:

In the following sections, the traditional approach is discussed and the issues there are with such an approach followed by the Portus approach.

The traditional approach

In order to access and update this data, applications must understand that there are two different tables or files and must understand the association between the files. They must also understand the requirements to keep these files consistent. In this case, when an owner is added with a OID number, the vehicles file must have a vehicle entry with that particular OID number. The access will normally be direct as per the following diagram:

graphics/BDVInt01.jpg

There are a number of issues with this scenario:

  1. For each request to get the data there is a requirement to make two requests to the back end database across what will normally be a busy network.

  2. The application needs to understand that the ‘OID’ returned is used to get the associated entry in the Vehicles table/file. While in this case, the OID number may be of value to the client, it may not be necessary for the client to see or know this. In many cases, keys are used simply as a means to locate a unique record and have no value outside the database itself. However, these must still be understood and manipulated by the programmer.

  3. For traditional access, software must be installed on the client system to access the back end databases. This costs time and money to keep up to date and, in many cases, has additional license costs associated with it.

  4. If the data model is not clear to the programmers developing on the client side, the databases may end up with inconsistent data.

  5. If the data is in multiple databases, there may be an issue with synchronizing updates to those databases unless an infrastructure supporting the two-phase-commit (2PC) protocol is available and in use.

The Portus approach

graphics/BDVInt02.jpg

This scenario offers a number of substantial advantages:

  1. Only one trip to the back end system is required to retrieve or update the composite object.

  2. The programmer does not have to know or understand internal links between tables or files and just has to deal with the fields and columns of relevance to the application.

  3. Portus needs to be installed on the server where the data is resident only, thus no software has to be installed or maintained on the client system apart from the client business logic itself.

  4. The owner of the data defines the model and thus programmers always deal with the business data view and need no understanding of how the data model looks in the background.

  5. Portus can take care of any transactional issues with data from different databases using the transactional capabilities of the backend system. This requires two-phase-commit (2PC) infrastructure to be present on the system, Portus will interface with it to guarantee transaction integrity.

Creating a BusinessDataView Service

A BusinessDataView based WebService is created in Portus based on existing "physical" WebServices. The physical service is the service that is created to directly expose a table, file or piece of business logic. This means that existing services defined to Portus may be reused in one or more Business Data Views. The Eclipse Control Center supplied with Portus is used to create the business data view as illustrated in the following diagram:

graphics/BDVInt03.jpg

As can be seen from the above, the BusinessDataView is built as a separate entity to reflect the "business entity" and is then linked to the physical data views. Some notes about the concepts:

  1. Only the fields / columns that are required in the BusinessDataView must be selected from the physical view. In the example above, city and address in the Owner (Personnel) table/file and color (and others) in the Vehicles table/file are not used in the BusinessDataView.

  2. Fields or columns in the physical view may be passed and parsed internally though not form part of the actually BusinessDataView. This is useful for passing internal keys to data which can sometimes be meaningless values simply to find data and thus have no value in being shown to a user.

  3. This is all achieved using a GUI provided as part of the Eclipse Control Center with Portus.

Top of page

Using the BusinessDataView WebService

Once the BusinessDataView Service has been created, it can be used in precisely the same way as any other Portus WebService. If the service is called ‘OwnerVehicle’ for example, the WSDL for the SOAP requests may be returned using the following URL:

http://<host>:<port>/OwnerVehicle?WSDL

This WSDL will expose the standard database CRUD services offered today for physical services by Portus namely ADD, DELETE, UPDATE, GET, LIST and the various SELECT methods. In the same way, to use the REST based interface, the following request will return the BusinessDataView for the Owner id ‘12345678’:

http://<host>:<port>/OwnerVehicle?F=GET&OID=12345678

All owners with an ID starting 1234 could be listed using the following URL:

http://<host>:<port>/OwnerVehicle?F=LIST&OID=1234*

Top of page

Working with BusinessDataView Objects

The following subsections show how the BusinessDataView Service processes the various types of requests.

Accessing a BusinessDataView Object

Portus can make this sample BusinessDataView object available as follows using the standard REST or SOAP Based access available with Portus:

graphics/BDVInt04.jpg

Some notes about the above:

  1. If the key for the vehicles file is not the same as the input key (here: OID) for the owner file it may be derived from data on the owner’s table/file.

  2. The OID only appears once in the output but it doesn’t have to appear at all.

  3. Any data from either table/file may be returned as part of the BusinessDataView object

  4. Using the Portus LIST functionality, it would be possible to get a list of owners and their vehicles using this service, or all vehicles for a single owner.

Adding or updating a BusinessDataView Object

When a new owner and vehicle(s) must be added or updated, Portus can achieve this as one standard REST or SOAP request:

graphics/BDVInt05.jpg

Some notes about the above:

  1. Either both adds to the physical database work or neither do using a transactional semantic and thus the database remains consistent. When more than one database is involved in the transaction two-phase-commit (2PC) capabilities are required to guarantee consistent transactions.

  2. All data is supplied in one request, this avoids the need for two round trips between the client and the server to add or update the objects (physical DataViews).

Deleting a BusinessDataView Object

When an owner and vehicle(s) must be deleted, Portus can achieve this as one standard REST or SOAP request:

graphics/BDVInt06.jpg

Some notes about the above:

  1. Either both (all) deletes from the physical database work or neither do using a transactional semantic and thus the database remains consistent.

  2. All data is supplied in one request, this avoids the need for two round trips between the client and the server to delete the objects (physical DataViews).

  3. While only primary keys for all affected files are required to delete the records, the same BDV used for add or update requests can be used.

Top of page

Additional features

Portus offers a number of additional features in addition to enabling the creation of BusinessDataViews based on "simple" scenarios as outlined in the previous sections

Data in Multiple Databases

When building a BusinessDataView, the data does not need to reside in the same database or even database technology. For example, the following illustrates how this would look with some data in ADABAS and some data in DB2:

graphics/BDVInt07.jpg

Some notes about the above:

  1. Adds, updates and deletes are also possible with this configuration but a transaction manager such as RRMS is required to ensure integrity is maintained between the databases.

  2. Databases can be replaced and or added as appropriate without the external business logic changing.

BusinessDataViews Including Business Logic

When building a BusinessDataView, the data must not be retrieved directly from a database. Portus can use any service defined by it as input for a business data view object. For example, the following illustrates how this would look with some data in ADABAS and a Natural subprogram providing additional data:

graphics/BDVInt08.jpg

Some notes about the above:

  1. Adds, updates and deletes are also possible in which case the application will be given an indication of the type of operation when it is called.

  2. The business logic may be running in (amongst others) CICS, COBOL, PL1, C etc.

  3. It is possible to create a BusinessDataView service based on business logic services only so no direct database access is required.

Top of page

Summary

It is clear that the Business Data View concept in Portus can provide an incredible level of flexibility to an organization in the following ways:

Top of page

Creating BusinessDataViews (legacy)

graphics/ccbdv01.png

To create a BusinessDataView select the target server, in the ConfigurationView select the BusinessDataViews tab

Right-click the ConfigurationView

Enter a name for the BusinessDataView to be created, click OK

Prerequisite - the BusinessDataView driver

Exposing BusinessDataViews as WebServices requires a BusinessDataView driver to be defined, if there is none already, proceed as follows

Example 1

The Adabas demo file "Employees" is keyed on personnel number and the "Vehicles" file also has a personnel number which determines which car is owned by which employee. We wish to define a BusinessDataView which gives us personnel id and surname of the employee and, if present, one instance of their vehicles car registration and date acquired.

Creating the BusinessDataView

Test the WebService

Example 2

We now define a BusinessDataView which provides more employee details plus a list of vehicle(s) for the employee..

Create the BusinessDataView

Test the WebService

Top of page

BusinessDataView Editor hints

This section provides you with a number of general purpose hints for making your life easier in respect to editing BusinessDataViews.

Zooming

When the BusinessDataView is too big, or the screen is to small to display it in its entirety at a resolution of 100%, or if you want to see some element(s) in more detail, the zoom level can be changed accordingly.

graphics/bdvex_zoom1.png

The initial display at 100%, not all details are visible.

graphics/bdvex_zoom2_portus.png

Reduce the zoom level, from the combo box located in the toolbar area, as required to see the entire graph.

graphics/bdvex_zoom3_portus.png

Increase the zoom level to a value above 100% to see more details.

graphics/bdvex_zoom4_portus.png

Making the BDV elements visible

In a busy BDV where there are several elements, it can be tedious to navigate using the scrollbars etc. There are 2 useful techniques available to make this easier, both using the Outline View.

If the Outline view is not visible, from the menu select Window -> Show View -> Other..., select Outline in the General folder and hit OK.

graphics/bdvex_navig2.png

In this example we have a populated LV plus 2 PRs, with the employees PR partially visible. To make the vehicles, select the entry in the Outline view as

graphics/bdvex_navig1_portus.png

To make the vehicles PR visible, select the entry (adabas_Vehicles in this instance) in the Outline view as shown below. The view will align itself with the PR selected. Notice also how the aerial view in the bottom right-hand corner has also moved the focus to the PR, with the darker blue rectangle reflecting the view in the BDV editor.

graphics/bdvex_navig3_portus.png

The latter is the other way focus can be shifted around the BDV editor. Select the darker rectangle and move it around its area. The moves will again be reflected in the editor.

graphics/bdvex_navig4_portus.png

Finally the view can be more fine grained. Open a tree view in the Outline view and select an individual field in the PRs or LV. The focus will shift to that selected.

graphics/bdvex_navig5_portus.png

When a Physical View changes

Or more precisely, when the DataView associated with an imported WebService changes.

Currently there is no way of automatically reacting to changes in underlying WebService DataViews, so when new fields are added which are to be used in the Logical View, there is no way of updating the imported Physical View within the BusinessDataView.

The only way to deal with such a situation is to remove the Physical View from the BDV, re-import it, copy the required fields to the Logical view and recreate the links between the Physical Views.

Following versions of the Portus Control Center will provide functions to capture changes to the underlying DataView(s) without having to recreate the Physical View and the links from scratch.

Top of page