This Section discusses the general tools used to develop the components of HealthAware.
Specic tools used to implement specic features are discussed when the feature imple-mentation is described. The tools used to implement the functions the HealthMessenger were constrained by TeleWeaver. As discussed in Section 5.4, the HealthMessenger will be hosted on TeleWeaver, which is based on JBOSS. Java and associated tools were used to develop the HealthMessenger to ensure that it deploys on TeleWeaver. The same tools were used to implement the functions the Dashboard for simplicity. The advantage of us-ing homogeneous tools is that the same skill sets were required to implement the functions of both components, and will be required to maintain them later.
74
6.2. TOOLS USED 75
6.2.1 Host Server Environment
As specied in subsections 5.2.1 and 5.2.2, the components were implemented as sep-arate Java web applications, each having a client/server architecture. Wildy version 8.2.0.Final was used to host the components during the development stage. The use of this environment ensures that the HealthMessenger deploys on TeleWeaver with few or no changes at all.
6.2.2 Development Tools
Some of the tools used to implement HealthAware include Maven, Spring Framework, and Spring Tool Suite. Maven is a software project management tool based on the concept of a project object model (POM).1 Version 2.2.1 of Maven was used to create the project and manage project library dependencies. Spring Framework is an open source framework created to simplify the development of enterprise Java software [89]. Four functional areas of the framework, namely Data Access/Integration, Web, Aspect-Oriented Programming (AOP), and the Core Container were used to simplify implementation of specic functions of HealthAware. The Data Access/Integration function was used to simplify the imple-mentation of object-relation mapping (ORM). The Web function was used to integrate the Spring into web applications. AOP was used to simplify the management of transactions.
The Core Container function was used to simplify the management of object references using Dependency injection (DI). Details of the Spring Framework, which include all of its functional areas, are found in Appendix A. Spring Tool Suite is a plugin for Eclipse that is customised for developing Spring applications.2 Eclipse is an open source integrated development environment (IDE) developed in Java that is used to edit and debug program source code.3 The plugin was used to edit and debug the Java source code, XML, and HTML scripts.
6.2.2.1 Creating Java Web Application Projects
A Maven template called maven-archetype-webapp, which is used to create Java web ap-plication projects, was used to create the projects to implement the two components.
The projects were created on the command line, converted to eclipse projects, and then imported as Maven projects by Spring Tool Suite.
1http://maven.apache.org/
2http://spring.io/tools/sts
3https://www.eclipse.org/
6.2. TOOLS USED 76
6.2.2.2 Project Library Dependency Management
Maven was used to manage the projects' Java Archive (JAR) library dependencies.
Con-guration details to enable Maven to download the required JAR les were added to the pom.xml le that is created for every Maven project. Listing 6.1 is an example of conguration details to enable Maven to download dependencies for Jersey to use Spring beans as Java API for RESTful Web Services (JAX-RS) components. Jersey is an open source framework for developing Web Services in Java according to the Representational State Transfer (REST) architectural pattern.4 It provides support for JAX-RS APIs and serves as a JAX-RS (JSR 311 & JSR 339) Reference Implementation. The JAX-RS API provides support for developing RESTful Web Services using Java. All the conguration details made in the pom.xml are available in Appendix C.1.
1 < dependency >
2 <groupId >com . sun . jersey . contribs </ groupId >
3 < artifactId >jersey - spring </ artifactId >
4 <version >1.12 </ version >
5 <scope >compile </ scope >
6 < exclusions >
7 < exclusion >
8 <groupId >org . springframework </ groupId >
9 < artifactId >spring </ artifactId >
10 </ exclusion >
11 < exclusion >
12 <groupId >org . springframework </ groupId >
13 < artifactId >spring - core </ artifactId >
14 </ exclusion >
15 < exclusion >
16 <groupId >org . springframework </ groupId >
17 < artifactId >spring - web </ artifactId >
18 </ exclusion >
19 < exclusion >
20 <groupId >org . springframework </ groupId >
21 < artifactId >spring - beans </ artifactId >
22 </ exclusion >
23 < exclusion >
24 <groupId >org . springframework </ groupId >
25 < artifactId >spring - context </ artifactId >
26 </ exclusion >
27 </ exclusions >
28 </ dependency >
Listing 6.1: pom.xml conguration details
The meaning of the XML elements used in Listing 6.1 are:
4https://jersey.java.net/
6.2. TOOLS USED 77
• groupId: This is the unique group ID of the project.
• artifactId: This refers to the name of the project.
• version: This refers to the version of the project
• scope: this refers to the classpath of the task at hand and is used to limit the transitivity of a dependency. Five dierent scopes are available:
compile - this is the default scope and indicates that the dependency should be available in all classpaths. Furthermore, those dependencies are propagated to dependent projects.
provided - this is similar to compile, but indicates that the JDK or a con-tainer is to provide the dependency at runtime.
runtime - this scope indicates that the dependency is not required for compi-lation, but only during execution of the program.
test - this scope indicates that the dependency is not required for normal use of the application and is only available for the test compilation and execution phases.
system - this is similar to provided except that the JAR le which contains the dependency has to be provided.
• exclusions: this explicitly tells Maven not to include the specied project that is a dependency of this dependency (in other words, it is a transitive dependency).
6.2.2.3 Wiring Dependencies
Spring Framework version 3.2.8.RELEASE was used to implement the components. Spring conguration details were added to the pom.xml le of the Spring Tool Suite to en-able Maven to download the required Spring dependencies. Four XML les, namely reedhousystems-data-context.xml, reedhousystems-component-scan-context.xml, reedhousy-stems-root-context.xml, and reedhousystems-servlet-context.xml were used to congure (or wire) Spring dependencies and to indicate the packages to scan for annotated classes that need to be registered automatically as beans in the Spring container.
The reedhousystems-data-context.xml congures hibernate session factory, data source, transaction manager, and hibernate properties. The hibernate session factory