• No results found

Chapter 4: SERVICE ORIENTED ARCHITECTURES AND WEB SERVICES

4.2 The Platform

eXtensible Markup Language or XML and its related languages such as XSLT44, XPATH45 and WSDL46 are used to build the components of the architectural framework, as well as being the way of exchanging data between these different components and forming database repositories for the adaptive services. In addition, the educational resources were stored in XML files.

Many reasons influenced the choice of XML, such as its flexibility with data; any information can be placed into XML. It is an open standard which makes it even more flexible and generic since no one company or organisation has control over it. Furthermore, XML allows for Web page integration for data driven Websites (sites which customise their content according to user choices and selections) and it provides enhanced scalability and compression (POWELL 2007). All this serves the principles of the new architecture in being generic, interoperable, and portable. Also, in terms of the databases, XML provides not only data but data structure as well. Thus it contains metadata (data about data), which is much needed for the purpose of interoperability in e- learning systems.

Another key aspect of XML is that it is simple to use and understand and so passing XML documents between different databases, components, and applications or systems is relatively easy. However, pushing XML into another type of database such as MySQL, used by the majority of LMS including Moodle and ATutor (chapter 3, sections 3.3.1 and

44XSL stands for: eXtensible Stylesheet Language while XSLT stands for XSL Transformation 45XML Path Language

3.3.2 respectively), is not a trivial task. Nevertheless, XML survives in heterogeneous environments but it might require the use of tools for specific databases or other standards for the translation or mapping. Hence, not only transferring XML itself but also sharing XML data and (ideally) automating the transfer of data between incompatible systems, would all eliminate the need of the custom coding (POWELL 2007). These capabilities resulted in XML being the language for Web Service technologies, which are services that provide some information over the Internet using a common, widely adopted transfer protocol such as HTTP.

An XML document is a database since it contains data and metadata which make it a repository of data, a very basic definition for a database. Using XML as a database has both its advantages and disadvantages. XML is object-structured and therefore capable of being used to build an object database. This object database has all the advantages of object-oriented techniques. These databases are much more capable of handling highly complex data structure when compared with relational databases, since an object breaks data down into smaller parts and the object design is therefore more flexible and efficient. On the other hand, XML databases become less efficient when dealing with a large amount of data. In other words, XML excels when dealing with complexity but not with scalability (POWELL 2007). Since the data size expected in the new architecture is relatively small (megabytes), the size problem was not an issue. Those XML-based databases were queried using XSLT, which is a stylesheet language that transforms XML documents.

4.2.2 PHP v4.3.1 and NuSOAP

The main reason behind choosing PHP is that the Learning Management System (LMS) in use - that is, Moodle - is developed and maintained in PHP. It would save time and effort to focus on one language to learn and use for the development process of the adaptation services, provided that this language works well in satisfying other requirements, which was the case with PHP. Nevertheless, given that the services are Web services, it does not matter which language was used for this development since everything is exchanged in XML.

PHP is a server-side scripting language that allows Web sites to be dynamic. Another feature that justified choosing PHP that it is a simple language with a short learning curve (NARAMORE 2005). Moreover, developing Web Services in PHP is made easy using specific classes and extensions freely available for users such as NuSOAP (Nichol 2004). NuSOAP is a group of PHP classes that allow developers to create and consume SOAP-based Web services. An additional good feature is its capability of creating WSDL description files (section 4.5) automatically. Moreover it creates an interface for that service that could be easily understood by ordinary users as in figure (4.1).

NuSOAP does not require any special PHP extensions, while such extensions are needed for using XSLT with PHP. In order to apply XSLT over XML using PHP, a special function called xslt_process (PHP 2008) is needed which in turn required installing additional PHP extensions. The XSLT module that comes with PHP must be enabled and for it to function properly, this module makes use of the open-source Sablotron XSLT processor. Sablotron, in turn, relies on the open-source XML parser, Expat (Yank 2001).

Figure 4.1: A Service Online Interface as produced by NuSOAP

The corresponding WSDL file is shown below in figure 4.2: