Benefits of Service Oriented Architectures
Introduction
Service oriented architectures allow for a standardized way of communicating between applications running on different platforms and on different hardware and software configurations. They achieve this through the use of standardized methods of making requests and accepting responses. They also achieve this by exchanging standard data formats such as JSON and xml (Pautasso and Wilde, 2010). Therefore, an application developer is able to create an application to communicate with another without the need of knowing the underlying implementation except the standard way making requests (Fayaza, 2014). The Service Oriented Architectures achieve this by exposing endpoints that external applications can connect with and make requests. These endpoints are in form of standard URLs with determined input parameters. The Service Oriented Architectures are also able to take advantage of loose coupling hence allow requests from many different applications (Sward, 2008).
2.0. Key System Concepts
2.1. Data merging and cleaning
Data from applications come from various sources. Most of these sources do not contain all the data required. Therefore, there arises the needs to merge the data to create a complete dataset that can be used to represent information in full. Therefore, several datasets may be merged. The problem arises when these data sources are not of a similar format. Some data may be stored in a database such as SQLite, or any relational database, flat text files, comma separated values, xml files and even JSON. This makes it necessary to have a method to read all this datasets and have a common representation that can allow the data to be merged in memory in real time. Many languages try to implement this functionality but python does it in a better way. There are various packages that allows the programmer to achieve this out of the box. A good example is the petl.
In this application, data came from several comma separated values and xml file. This data was read using petl and merged using key columns. For example, clinics have location identifiers and locations have identifiers and name. thus the two were merged using the location identifier. Apart from merging, the data requires cleaning to ensure it’s completeness and also it conforms to the required standards. For example, in this activity, the email had to be cleaned by removing spaces, and ensuring is has an email format.
2.2. RESTful Web Services
The most popular of implementing SOAs is through RESTful Webservices. REST is an acronym that stands for Representation State Transfer. It is a standardized way of communicating between applications. It works by works by being stateless thus no need to track user sessions. Various methods are implemented such as GET, POST, PUT, DELETE. The applications specify the method and the application responds appropriately depending on the request method. Apart from the request, the application can specify parameters as defined in the endpoint. The application is then going to parse the parameters use them to maybe access a specific resource identified by the input parameter. Some requests such as post allow sending of a large amount of data and can therefore be used when trying to save information in a database.
2.3. Mashups
The mashup application is made up of html webpage that sends request to the application and receives the data in form of JSON. JSON is an acronym that stands for JavaScript Object Notation (ECMA, 2017). The mashup sends data through post and get requests using Javascript and receives the JSON responses. The Javascript then parse the data and represent it on the page by querying Google maps and representing the information on the page in real time.
3.0. Demo and Running Instructions
In order to run this application, the application must be hosted behind a server. This is because most of the requests implement the HTTP stack. Luckily, python has an easier way of running web applications using an in-built server. To be able to run the application, to therefore need to have python installed. The installation will allow you to start and stop the server as well as take advantage of the python runtime environment. To starts a server, you just have to navigate to the directory of you application and start the python server. Python implements the simpleHTTPServer by default. To start the server, you just have to run the following command
python -m SimpleHTTPServer 8000
The above command will start the python server at localhost on port 8000. You can specify another port other than the default 8000. After starting the server, the application will be listening on requests from https://localhoost:8000/. Here you can now send your request and receive responses from the application.
Conclusion
The application has been able to show how applications can be able to send requests using a standardized format. Additionally, it has shown how data can be merged from various sources, cleaned and encoded in a standard way such as JSON and then exchanged between applications.
ECMA (2017) ‘ECMA-404 The JSON Data Interchange Syntax’, (December).
Fayaza, F. (2014) Service Oriented Architecture in Enterprise Application. doi: 10.13140/RG.2.1.3597.8087.
Pautasso, C. and Wilde, E. (2010) RESTful Web Services: Principles, Patterns, Emerging Technologies, Proceedings of the 19th International Conference on World Wide Web, WWW ’10. doi: 10.1145/1772690.1772929.
Sward, R. (2008) SP1: service oriented architecture (SOA) concepts and implementations for Ada, ACM SIGAda Ada Letters. doi: 10.1145/1454497.1454477.