Middleware applications are normally build in a structured way – according to some architecture. However, often this structure can’t be recognized in the implementation. This article describes some simple measures that can be taken to improve on this point. The article does not intend to be complete, but it should inspire to bring structure to middleware environments.
Adding structure to a middleware implementation will be of benefit to practically everyone who is involved. Some examples of tasks that will be easier to do:
- impact analysis for changes
- selection of artefacts for deployments
- analysis of runtime exceptions
- learning curve for newbies
An obvious candidate for ‘Application Structure’ is of course the ‘application architecture’, where the system is described in functional blocks. These blocks should be clearly identifiable in the application implementation.
Other candidates for adding structure are ‘company organization’ and ‘business processes’.
The remainder of this article takes (part of) the AMIS organization as an example:
- Marketing: the marketing department
- Consulting: the consulting teams: UX, SOABPM, Platform and Architecture
- Finance: the financial department
- Secretariat: the secretariat that also covers HR
In this organization, we will implement BPM processes, e.g. ‘EmployeeOnboarding’ – a process that is owned by the Secretariat. This EmployeeOnboarding process uses two services:
- Employee service – owned by the secretariat and that supplies information about employees
- Salary service – owned by the finance department and that supplies financial information about employees
The application name for implementation of the BPM processes and services is ‘AmisProcesses’ – for lack of real inspiration
Let’s assume that we’re building a middleware application for the services/processes of these departments.
Structure – but where?
You application structure should be visible in as many places as possible Think of:
- Software archive (e.g. svn)
- Namespace composition
- Service endpoints
- SOA Suite deployment topology
- MDS structure
The software archive will be structured in the following way:
Note that the structure reflects the organization structure, and that the branches/tags/trunk split is made at the service level, i.e. the level of the deployable artefact.
Namespaces are structured in a similar manner, including an indication of what the namespace is intended for. Examples below:
- For services:
- For messages:
- For processes:
Probably the most common situation is that where a loadbalancer is used in a high available clustered set-up. Also the endpoints that are used for accessing the services can follow the same structure:
Here, the dns will get the entry for loadbalancer.amis.nl.
However, often loadbalancer routing uses only the first part of the URL path (above: ‘amisprocesses’). In such cases, the below URL is a better alternative:
Application deployment topology
The application deployment topology is about what to deploy where. The only structuring mechanism for BPM/SOA Suite deployments is the ‘partition’. That mechanism is not recursive, i.e. it is not possible to have partitions under a partition. So, in our example we will have the following partitions:
- soa composite Salary_1
- soa composite Salary_2
- soa composite Employee_1
- bpm composite (process) EmployeeOnboarding_1
The MDS also has – again – the same structure:
By now, this article should have become quite boring. Which is exactly the goal of adding structure: simple = boring = predictable = good.
Similar to the middleware artefacts, the structure can be extended to the java artefacts. If an XSL extension function has to be built for the Employee service, the java package name would be
Note that in java programming environments, structuring of sources into meaningful packages is ‘natural habit’ of programmers.
For most of the above items, the anti-patterns are obvious.
Consider e.g. an SVN structure:
… where the artefacts are grouped on their technical aspects.
Consider a namespace like:
… which doesn’t give much clues as to who owns it and what it is used for.
And perhaps the most annoying one is a production system with all composites deployed in the default partition. Perhaps it would be a good idea to always remove the default partition for a non-development installation?
Structure is everything!