A component framework for reusing a proprietary ...

5 downloads 128304 Views 1MB Size Report
to-use object-oriented interface, that give access to the entire functionality of ... framework that focuses on rapid application development. (RAD), robustness ...
Advances in Engineering Software 38 (2007) 256–266 www.elsevier.com/locate/advengsoft

A component framework for reusing a proprietary computer-aided engineering environment Emilio G. Rosello´ a, Marı´a J. Lado b,*, Arturo J. Me´ndez b, Jacinto G. Dacosta a, Manuel P. Cota a a

Department of Computer Science, Edif. Fundicio´n, University of Vigo, Campus Lagoas-Marcosende, 36200 Vigo, Spain b Department of Computer Science ESEI, University of Vigo, Campus As Lagoas, 32004 Ourense, Spain Received 19 December 2005; received in revised form 9 August 2006; accepted 16 August 2006 Available online 23 October 2006

Abstract Nowadays, it is becoming more frequent for engineers to deal with problems and situations that require specific software and the commercially available applications may not result adequate. Because of this, the reuse of software components is becoming a normal practice for improving the productivity of the software programmers, and the quality of the products that they develop. The employment of reusable components presents a number of advantages, such as the reduction in time necessary to develop new software, or the simplification of many computational tasks. There are some proprietary software environments in the engineering domain that are practically de facto standards, since they offer a broad functionality, robustness and constant updating. Therefore, those environments could be ideal candidates to be reusable components when developing new software. An example of this is Matlab, which can be encapsulated, in order to use it as a true reusable component. This will provide the user with efficient tools for designing his/her own applications. Moreover, there is an increasing importance for any software to offer distributed services. To perform this task, it is fundamental to have at one’s disposal reusable components that support Internet-based distributed applications and services development. In the present work, a software component framework that effectively encapsulates Matlab is described. This software allows developers the reuse of Matlab, for both local and distributed applications. To address those issues the .NET technology was employed. The component framework developed can be integrated in the toolbars of software development environments supporting the .NET framework. This facilitates the construction of applications that can reuse the components, since the software developers can use and test them and change their properties in design-time. Ó 2006 Elsevier Ltd. All rights reserved. Keywords: Software engineering; Reusable components; Matlab; Web-based technology

1. Introduction Over the last few years, component-based development is becoming a normal practice for improving the productivity of the software programmers, and the quality of the *

Corresponding author. Present address: Departamento de Informa´tica, Escuela Superior de Ingenierı´a Informa´tica, Campus Universitario As Lagoas, 32004 Ourense, Spain. Tel.: +34 988 387 012; fax: +34 988 387 001. E-mail address: [email protected] (M.J. Lado). 0965-9978/$ - see front matter Ó 2006 Elsevier Ltd. All rights reserved. doi:10.1016/j.advengsoft.2006.08.014

products that they develop. There are many computeraided design (CAD), computer-aided engineering (CAE) and computer-aided manufacturing (CAM) commercially available environments, such as Matlab [1], AutoCad [2], LabVIEW [3], Maple [4] or Pro/ENGINEER [5], but these environments, even if they have part of the required functionality, are not always the adequate tools to build software that copes with specific requirements. Despite the limitations imposed by the standard user interfaces, the APIs (Application Programming Interface) and extensibility tools (when they exist) of these

E.G. Rosello´ et al. / Advances in Engineering Software 38 (2007) 256–266

environments, several users and programmers decide to use them anyway. However, there is an increasing number of developers and researchers that do not resign to these limitations, and choose to develop their own programs [6–9]. It must also be considered that the problems to solve are continuously growing in size and complexity, as well as the codes, mathematical procedures and data control. This requires a high-level of maintenance, new developments and reuse of the software whenever it is possible. All these factors make the software developers to plan, every time more frequently, to include reusable components to develop a new product. The employment of reusable software components presents a number of advantages: (1) if a considerable part of the components used to develop new software are already being used elsewhere, this implies that the programmers only have to develop a part of the new software, this reducing the time for implementing the product and, consequently, the cost [10]; (2) many engineering problems include iterative and time-consuming algorithms. The implementation of these algorithms can be a very difficult task, and it could be simplified reusing software [10]; and (3) if the users are forced to adapt their thought processes to existing software systems, then this can hinder the acceptance of the system by the users. The Web-based technology has become an infrastructure for large-scale computations and a platform for distributed and collaborative applications. Web-based applications can be accessed anytime, anywhere worldwide from any platform, and Web-based platforms can host many users and execute many user requests at the same time. Therefore, the integration and interoperability are decisive factors when building software from reusable pieces that are located on distributed systems. Due to all the benefits of reusing components, there is a complete agreement about the desirability of reusability, and the idea of software components that can be reused by many applications, users and interfaces, is greatly appealing. To reuse components we need reusable components, but not any piece of software can be considered as a reusable component. On the opposite side, to be really reusable, a component must be specifically developed with this aim, following a component model and several fundamental guidelines [11–13]. Designing a methodology for developing reusable software is not an easy task, and a considerable effort must be addressed at constructing these components. Nowadays, there are some proprietary software environments in the engineering domain that are practically de facto standards, since they offer a broad functionality, robustness and constant updating. Given those features, several of them could be very interesting candidates to be reusable components in engineering software development. One example of this software is Matlab, highly used by engineers for very diverse tasks, such as its integration into parallel and distributed applications [14], collaborative use [15], or teaching processes [16,17].

257

However, having the required functionality is not sufficient for a piece of software to be effectively reused, and other features are needed, such as encapsulation, a useful and friendly API, independency of platforms, languages and user interfaces and the compliance with a component model. Matlab does not satisfactorily cope with those requirements. The aim of this work is to propose a solution to the limitations imposed by the Matlab environment, in order to allow for reusing its wide functionality. It is based on the encapsulation of the proprietary environment, providing a framework of highly reusable components, objectoriented, platform-independent, and enabling Web-based development. In this way, developers are provided with components and visual controls with a simple and easyto-use object-oriented interface, that give access to the entire functionality of Matlab, that can be integrated in their development tools, allowing them for designing their own applications in a simple and intuitive way. This means that the user does need neither to use Matlab nor to learn it, and the developers do not directly have to use Matlab for the software development. This work is based on a previous reduced prototype developed as a COM (Component Object Model) library that showed the viability and interest of our approach [25]. The solution that we describe here, called IMO.Net framework for Matlab has been developed on the .NET component model, due to its very interesting features to empower software reusing in heterogeneous environments and to address Web-based development specific issues. Recently, the .NET technology has arisen as a powerful framework that focuses on rapid application development (RAD), robustness, reusability, and language independency [18,19]. It includes many technologies designed to facilitate RAD for Windows as well as for Internet and Intranet. Other important aspect of .NET is that the programmer can also easily develop and reuse components and Web-services, and it supports a large number of different high-level languages. Even if .NET supersedes the COM model, it maintains backward compatibility with it, and with all the applications and development tools that support COM. The .NET technology is currently fully available only on Windows platforms. However, several implementations are currently in progress to allow for its total availability for other operating systems, such as Linux or Mac OS, via Mono, which is an open source implementation of the .NET runtime and development libraries [20]. Anyway, Web-based services and applications developed on .NET are naturally available from any client platform, since they are based on SOAP (Simple Object Access Protocol) [21]. The paper is organized as follows: Section 1 presents an introduction about the necessity and usefulness of reusable components, as well as a brief explanation of the IMO.Net framework; Section 2 gives a description of the model developed; Section 3 includes some examples of different applications of reusing components; and Section 4 presents

E.G. Rosello´ et al. / Advances in Engineering Software 38 (2007) 256–266

258

a discussion about the utility of the developed component. Finally, conclusions are given in Section 5. 2. Model description The IMO.Net framework for Matlab if composed of three main pieces: (1) a basic library that contains the kernel functionality of the framework; (2) a set of Web services to allow for distributed applications development; and (3) a library of visual controls to empower visual applications development. Next we describe each one of these pieces. 2.1. IMO.Net basic library for Matlab In order to build the IMO.Net framework for Matlab, we have first developed a .Net library called IMO.Net basic library for Matlab. This library was designed to encapsulate the basic functionality of Matlab, providing a true objectoriented interface which could be effectively used for applications development, without limiting the access to all the power of the Matlab engine. In this library, a set of abstract interfaces is defined. These interfaces encapsulate the entities that must be manipulated by the developers when they are building applications that reuse Matlab: sessions, different types of variables, figures and functions. An UML diagram of those interfaces showing the inheritance and dependency relationships is shown in Fig. 1. When defining this set of interfaces, the main goal is to provide independency of the internal implementation details to the developers reusing the library, and to expose the same interfaces for different implementations. For example, this allows programmers for writing the same code without considering if they are using components devoted to local or distributed applications, as we will explain later. The IIMOMatlabSession interface encapsulates a work session. Due to the fact that most of the calculations are not generally intended to be done in a single step, the ses

IIMOMatLabFigure



IMatlabArray IIMOMatLabToken



IIMOMatLabSession

IIMOMatLabFunctionCaller

IIMOMatLabCharArray IIMOMatLabCellArray IIMOMatLabStructArray

IIMOMatLabVar

IIMOMatLabObject IIMOMatLabString IIMOMatLabNumericArray

Fig. 1. UML diagram of the interface set of the IMO.Net basic library.

sion allows a client application for the definition of variables, and to perform several operations in its own persistent workspace [22,23]. This interface offers generic methods to manipulate a session and its contents; for example, to open or close it, to clear the workspace, to obtain the list of defined variables, import and export data, load and save a session, execute commands, use toolboxes, manipulate figures, etc. All the other interfaces rely on the basic services of this one to work. The IIMOMatlabToken interface represents any Matlab entity and serves as a basic interface to other interfaces. The IIMOMatlabVar interface encapsulates a generic Matlab variable, offering services to name it, to know its dimensions, its class and to cast it to a well-defined type. The descendants of IMMOMatlabVar encapsulate the different classes of variables of Matlab, offering specific services for each one (for example, to recover the value of a cell in a cell array; to obtain a list of fields of a struct; or to get and put values in a numeric matrix). The IIMOMatlabFigure permits to create figures, copy them to the clipboard, save them, etc. The IIMOMatlabFunctionCaller interface allows for calling a function, setting its arguments, and getting its result as an IIMOMatlabVar object. Finally, the IMatlabArray interface encapsulates a Matlab matrix, allowing for accessing, modifying and manipulating it in different ways. For example, it permits to manipulate multidimensional matrices as such, hiding the details of the internal storage model used by Matlab, who actually stores all as two-dimensional arrays. It allows for moving along a matrix in different ways: first dimension first, by rows, or by slices of arbitrary dimensions. It also offers the possibility of converting an IMatlabArray to a native .Net array or a vector. This allows a simple manipulation to the programmers. Since all Matlab variables are matrices, all the other interfaces use IMatlabArray to receive or return data. The IMO.Net basic library for Matlab also contains a set of components, based on a class hierarchy that implements the interface structure previously described. This set of components, whose names correspond to the abstract interfaces replacing the ‘‘IIMO’’ prefix by the ‘‘Local’’ one, is intended to be used for local applications, since they require access to a Matlab engine installed on the local machine to work properly. The access to the Matlab engine has been performed using the native OLE Automation server interface of Matlab, devoted to the development of external applications [24]. This API actually runs a Matlab session in a similar way than the user does, but it allows for hiding the windows, sending the commands to be executed by the Matlab engine, and retrieving various results. The IMO.Net basic library is implemented on this API. It offers high-level services, such as a potential save of computational time and effort to developers. The schema described here allows a developer for building, in a very easy way, local applications that manipulate sessions, variables and figures, as well as to execute any

E.G. Rosello´ et al. / Advances in Engineering Software 38 (2007) 256–266

259

function in the Matlab engine. The programmers only have to deal with very simple and intuitive object-oriented components, i.e., with objects created and managed as any other object of the development tool used to build its application (it is intended that the development tool employed must have object-oriented capabilities). 2.2. IMO.SOAP web services To support distributed applications development, we have built a set of Web services called IMO.SOAP web services. They are available for remote clients through SOAP. Those Web services were easily developed reusing the components already available in the IMO.Net basic library for local application development, described above. The Web services almost act as mere wrapper intermediaries between the remote clients and the local components. They also have to manage the conversion of some complex data types into a SOAP-supported form. SOAP is not session-oriented, and it does not keep objects state between calls, which would be a problem. This was avoided with the use of ASP.NET technology, which incorporates the possibility of assigning a session to a client and store its status to keep it available for the next requests of the same client. The developed Web services offer very similar interfaces than their corresponding local components, thus making easier for the developer to update a local application to work in a distributed environment. To properly work, the Web services have to be installed in a Web server, to have access to the IMO.Net basic library, and therefore to a local Matlab engine. The remote clients do not need any special feature, and it is not necessary to have Matlab installed. They simply have to access the remote services through SOAP. This allows for developing applications which can perform even heavy calculus tasks on Matlab, but are able to run in lightweight clients, compared to the requirements of the Matlab engine to properly work in a local computer. To simplify the development of the distributed applications, we have built a set of components that exactly implements the abstract interface set shown in Fig. 1, and works with those Web services. Since they implement the same interfaces than the components for local applications, they completely hide the slight differences between the development using the components for local applications and the Web services (for example the need of explicit manipulation of a SOAP connection, wrapper objects, or to convert some data types). This component set has been placed on the IMO.Net basic library. Furthermore, a developer can easily build dual applications, which will be able to work with both component sets, because they have exactly the same interfaces. Thus, one can use either a local Matlab engine or a remote server. The application only has to instantiate the desired components according to the situation. Of course, an application built in this way needs to have locally installed the IMO.Net basic library to work properly, even if it works

Fig. 2. IMO.Net component framework architecture.

against a remote server, but it only needs a local Matlab engine if it works with the component set for local applications development. The developer can always write a distributed application which directly works with the Web services via SOAP, and this does require neither the IMO.Net basic library nor the Matlab engine to work. The resulting architecture is shown in Fig. 2. 2.3. IMO.Net dataviewers for matlab To empower reusability and to facilitate GUI applications development, we have developed a set of visual controls that work as data viewers. There are five viewers, one for each main type of Matlab variable (cell arrays, struct arrays, char arrays, numeric matrices and objects). They can present multidimensional matrices, allowing the user for the navigation through their contents and edit them. The struct, cell and object array viewers include detailed information of the content of the fields, cells or properties, respectively. There is another visual control that presents the list of variables defined in a Matlab session. All viewers use the same set of icons to visually identify each type of variable, and have a very similar aspect to be easier to handle by the users. Finally, there is a viewer that can show a Matlab figure, and a tabbed control that displays all the figures defined in a session, each one in a tab. Those controls are packed in a component library, called IMO.Net DataViewers for Matlab. They are built to work with the IMO.Net basic library. For example, all the viewers have a MatlabSession property that permits to assign them an object that implements the IIMOMatlabSession interface, and from which they will obtain the information to perform their task. Those properties can be edited at design-time, thus facilitating the developer’s work. Since these properties rely on abstract interfaces, these controls can work with the components for either local or distributed applications. Both of the described component sets from the IMO. Net basic library implement the System.ComponentModel.IComponent interface, to be compliant with the

260

E.G. Rosello´ et al. / Advances in Engineering Software 38 (2007) 256–266

.NET component model. In the same way, all the controls included in the IMO.Net DataViewers inherit from System.Windows.Forms.Control. That allows not only for their reuse from any other .NET or COM application, but also their inclusion as design-time components in all .NET-based development tools (Fig. 3), such as Microsoft Visual Studio, Borland Delphi or PCSoft Windev. This feature, widely harnessed by most of the used visual development tools, facilitates reusability, because developers can install the components in their toolbars, add them at design-time to the applications, customize properties, add code to handle events and even test them [12]. All the components contained in IMO.Net the framework are CLS (Common Language Specification) compliant, to ensure that they are fully reusable independently of the programming language. Fig. 3 shows a Microsoft Visual Studio .Net development project. In the left hand side, we can see the toolbox toolbar, where the described components and controls have been added. At the middle, a form containing an added NumericArrayViewer (above) and a StructArrayViewer (down) is shown. At the bottom, we could see that three components have also been added to the form: a LocalMatlabSession, a LocalMatlabNumericArray and a LocalMatlabStruct. The viewers have been connected to those components, and the MatlabSession component has been activated in design-time, to ensure that it opens a Matlab engine. This allows for displaying data in the viewers at design-time. In the right hand side we can see the design-time properties list of the MatlabSession component. This example can be done without having to write a single code line, only using the mouse to add the compo-

nents and controls to the form, and adjusting some properties. 3. Applications of the imo.net component framework Several applications were developed using the IMO.Net framework previously described in Section 2. In this way, their usefulness and simplicity of use in different domains was tested. Some of the applications are briefly described in the following Subsections. 3.1. Integration in Microsoft Office suite The first application developed was a simple module that encapsulates the calls to the IMO.Net basic library through simple functions developed in Visual Basic. A preceding version of this module was previously developed and described in [25], employing the previous COM-based prototype of our framework. To perform the integration, some simple functions were created in a Visual Basic module. The Matlab functions can be invoked from any macro or Visual Basic module developed in any of the MS Office applications (obviously, both Excel and Access are the preferred targets). This module defined several usual functions that could be used, for example, in a worksheet form MS Excel or in an MS Access query in the same way than the proper functions of the MS Office suite. It can also facilitate the development of MS Access applications that need to perform complex calculations with data from databases. As an example, a project that is currently underway with our collaboration manages a large amount of data

Fig. 3. Integration of the IMO.Net components and controls in Microsoft Visual Studio.

E.G. Rosello´ et al. / Advances in Engineering Software 38 (2007) 256–266

extracted to evaluate the water quality of several rivers of the North of Spain, for environmental monitoring purposes. An application developed on MS Access allows for data capturing and management, as well as for report generation. A relatively complex numerical analysis, such as PCA (Principal Component Analysis) or K-Means classification is also required to determine the reference sites, classify and test new sites, etc. . . (for a reference text about the type of employed monitoring techniques, see for example [26]). The solution being designed integrates these statistical treatments in the own MS Access application, by exporting data from the database to Matlab, calling the Matlab routines at runtime, and retrieving results to store them in the database, employing the IMO.Net Basic library. With this solution, the user does not have to control several applications and to manage the data exchanging. In this way, it eases the development work, since the user only has to deal with the MS Access application. To illustrate the simplicity of using IMO.Net Basic library from MS Access, a very simplified example of a routine written in Visual Basic for Access, which uses the data

261

of a query to calculate a classification in Matlab is shown in Table I. 3.2. Model-Lab software environment Model-Lab is an ecological modelling software, previously developed by our research group [27], that allows for building ecological models based on mathematical equations, and studying their dynamic behaviour in a very easy and visual manner. Model-Lab has been conceived to be easily extensible. For example, it permits to add new function libraries at runtime through Dynamically Linked Libraries (DLLs). A DLL wrapper module to integrate Matlab in Model-Lab employing the .NET component framework was also developed, allowing Model-Lab users for using all the functions of Matlab, to define the equations of the models, but still using the Model-Lab GUI, specially designed for ecological modelling (Fig. 4). An example of the availability for Model-Lab of the acoth function (inverse hyperbolic cotangent function) is shown in Table II. It has been a simple task to create the wrapper module to provide access to the Matlab functions

Table I Example of a routine that uses the data of a query to calculate a classification in Matlab, written in Visual Basic for Access

262

E.G. Rosello´ et al. / Advances in Engineering Software 38 (2007) 256–266

Fig. 4. Model-Lab architecture integrating the IMO.Net framework.

Table II A simple wrapper to allow Model-Lab for calling a Matlab function

from Model-Lab. The first tests have been satisfactory in terms of performance. The added overhead to call Matlab has also been considered acceptable. Except for the fact that they have a largest library of functions at their disposal, for the pointed overhead in execution time, and that they have to possess a Matlab license installed, this enhancement has been transparent for the

users regarding to the GUI (Graphical User Interface) they use, that has been unchanged. This example shows the benefits of developing a specific GUI, a modelling environment for instance, which operates as a front-end that offers the desired user interface, but delegating the calculus work to an existing engine, such as Matlab. This solution can be easily performed with the

E.G. Rosello´ et al. / Advances in Engineering Software 38 (2007) 256–266

263

IMO.Net Framework, which provides the required reusability to Matlab. 3.3. R-Interface R-Interface has been developed as an alternative user interface for the Matlab engine, integrating it as a reusable component, and completely hiding the original Matlab user interface. A detailed description of its features can be seen in [28]. Formerly developed as a Win32 application, using the prototype COM library of our framework, a new version of R-Interface has been built to work on .NET platform, and reusing the IMO.Net framework. Therefore, R-Interface supports the same functionality and command language than Matlab, but provides a more user-friendly interface. It supports either local or remote sessions. Thus, if we have a remote IMO.SOAP Web services at our disposal, it can run on thin clients without installing Matlab (anyway, the user needs a Matlab license for each user or a license for a network installation, certainly). It also offers an MDI (Multiple Document Interface), allowing the user for easily working with multiple sessions (local o remote) and copying variables between them. It integrates wizards (that can be developed by third parts) to guide the user step by step to perform specific tasks, as well as a Web explorer and data viewers to explore Matlab variables. The development of R-Interface has been largely benefited from the reuse of the IMO.Net basic library to implement its functionality, as well as of the IMO.Net DataViewers, to build a large part of the user interface, and reducing to the half the time needed to develop it, related to the previous COM-based version. 3.4. Domain-specific component libraries One of the most interesting applications of the IMO.Net framework is its use as a basic component library to build other reusable component libraries. Even if the IMO.Net framework can be considered widely reusable, since it offers a large functionality, it cannot be forgotten that reusability is closely related to domain [29]. Therefore, the reusability of a component decreases when its functionality becomes too generic. If this is the situation, it is more convenient to have reusable components with a more specific functionality. In fact, this is the same principle that leads to the development of Matlab toolboxes for specific domains. Following this principle, we have started to develop specific-domain reusable components which reuse the IMO.Net framework to access the Matlab functionality. This makes their development easier, as they benefit from the services offered by it: session and variables management, data exchange, classes to easily manipulate data types, etc. Moreover, they have, at the same time, its capabilities, for example development of local and distributed applications. Even if the IMO.Net framework already gives access to all the functionality of Matlab toolboxes, through the possibility of executing their functions, it is more useful

Fig. 5. IMO.Net Neural Networks Library Architecture.

to have components that directly encapsulate these functions, mainly for two reasons: (1) since the call syntax will be verified at compilation-time, it simplifies their use; and (2) those components can expose interfaces and implement classes which hide some of the complexity of the Matlab functionality. Until now, two of these specific-domain component libraries have been developed: the IMO.Net Matrix library, which defines a large set of functions to operate with numeric matrices, and the IMO.Net Neural Networks library, whose functionality fits in a large extent to the Neural Networks Matlab toolbox. It follows a model that offers two set of interfaces (Fig. 5). One interface set maps the functions and data types offered by the encapsulated Matlab toolbox. Thus, it can be more familiar for developers who already know this toolbox, but with the benefit of being used as a reusable component library, with compile-time verification, full integration with the programming language, etc. The other interface set is designed on the top of the preceding one, as a true object-oriented interface, establishing a class hierarchy where the different types of networks are defined from more generic classes. It hides the complexity of the Matlab toolbox to offer a simple and easy API. The developer can choose to use any of these interfaces, or both. It must also be noted that the components of this library are built to be easily integrated with the IMO.Net framework. For example, the classes that encapsulate the neural networks always provide a reference for the IIMOMatlabObject that they internally use, which is the interface of the IMO.Net framework that encapsulates a generic Matlab object variable. Therefore, developers can always access the underlying IMO.Net framework components used in the library, allowing for working directly with them if necessary. To illustrate the benefits of reusing the IMO.Net framework in the development of these domain-specific libraries, Table III presents a piece of the code that implements the low-level API of the IMO.Net Neural Networks library.

264

E.G. Rosello´ et al. / Advances in Engineering Software 38 (2007) 256–266

Table III Example of a MatlabNeuralNetwork class

This code defines a MatlabNeuralNetwork class, which corresponds to the ‘‘network’’ class defined in the Matlab Neural Networks Toolbox, and shows how some properties that allow for the configuration of the network are implemented. Several specific-domain component libraries are currently under development, such as the IMO.Net Wavelet library to operate with wavelets, and the IMO.Net Symbolic library, based on the Matlab Symbolic Math toolbox. The development of those types of specific-domain component libraries can be done by independent third-part developers, by simply having the IMO.Net framework to reuse it with their own components. In fact, several of the cited libraries are developed by collaborators not involved in the IMO.Net framework project, who only have access to several specific files and documentation of the IMO.Net framework. 3.5. Neuro-Lab software environment A software called Neuro-Lab, dedicated at designing and teaching neural networks was also developed in the last years by our research group [30]. The main goal was to provide different types of artificial neural networks and training algorithms, but maintaining the visual user interface,

specially designed to be simple and easy-to-use by users without expertise on neural networks. In the present work, Neuro-Lab has integrated the IMO.Net Neural Networks library described above. Therefore, it keeps offering a user-friendly environment but now with all the functionality of the Neural Networks Toolbox of Matlab, and more powerful than the previous implementation that only had a few network types and training algorithms. It also benefits from the possibility of remote access to IMO.Net SOAP servers via Internet. 4. Discussion In the present work, a software component framework that encapsulates Matlab and effectively allows for reusing its functionality to build applications is described. This framework includes a basic component library that encapsulates sessions, figures, function calls and data types of Matlab, allowing for manipulating them as objects. We have also developed a library of data viewers, as visual controls, for all the Matlab data types. Since this is a functionality commonly required, the developers can benefit from reusing those components in their applications. The developed components can be integrated in the toolbars of development environments supporting the

E.G. Rosello´ et al. / Advances in Engineering Software 38 (2007) 256–266

.NET platform, such as Microsot Visual Studio or Borland Delphi. This facilitates the construction of applications, since the developers can easily reuse them in design-time. The framework also includes a set of Web services to make available distributed applications development. Since those Web services are based on SOAP, they are open and platform-independent. It must be taken into consideration that the word component is tremendously ambiguous, and subject to many different interpretations [13]. The most frequent is related to any type of material that can be reused, from an applet to a piece of code [31]. However, a more formal definition considers a software component as a software element that conforms to a component model and can be independently deployed and composed without modification, according to a composition standard [12,13]. Moreover, a component model defines specific interaction and composition standards, being a component model implementation the dedicated set of executable software element required to support the execution of components that conform to the model [13]. It must be noted that a really reusable component must be a piece of software explicitly developed to be reused over a well-defined component model or platform, such as COM, JavaBeans, or .NET. In this sense, Matlab is not a reusable component, since the Matlab APIs do not verify the previous requisite. In this work, we have overcome those limitations of Matlab, providing the necessary encapsulation to make available the Matlab functionality in a really reusable component framework. At the moment, the engineering software applications are moving to the Internet. Web-based platforms provide an open and distributed environment for efficient use of software applications, developed by different programmers and dedicated to diverse users. In this way, Web services are a promising technology to offer distributed reusable components, independent of platforms and worldwide accessible. The IMO.SOAP Web services are an example of the usefulness of those services. They allow for accessing a specific functionality without having to install additional software. This could have a significant influence on costs: savings can be done in software installation and configuration tasks, time-to-availability, and even in hardware, since sometimes thin clients can be sufficient. By the contrary, more powerful machines would be required if all the software had to be locally installed. Although the IMO.SOAP Web services allow for accessing the Matlab functionality from remote clients on Internet, at this time only a single-user per session is supported. This means that each user opens and works with its own Matlab session. This is necessary for avoiding the interferences among various users’ work. This is not suitable for collaborative applications, where the capability of sharing a single Matlab session among several collaborating users is needed. This feature is likely to be added to our framework. In previous works, we have developed a prototype of this framework based on COM, for local applications,

265

and SOAP Web-services based on CGI (Common Gateway Interface) [25,28]. In this work, this technology was replaced by .NET, and the framework functionality and usefulness were considerably increased. It must also be noted that .NET provides support for different ISO standards, such as ISO/IEC 23,270 (C#), ISO/IEC 23,271 (CLI) and ISO/IEC 23,272 (CLI TR). The applications and specific-domain components developed reusing the IMO.Net framework have shown its significant reusability, usefulness and ease of use. It can be suggested that a similar solution could be applicable to other widely used CAD-CAM-CAE environments that, in a similar way than Matlab, have a large functionality in their domains, but suffer from limitations to be reused as components in other applications. An important issue to take into consideration are the proprietary software environment licensing conditions. In general, Matlab requires a license for each user (group licenses with limited number of simultaneous users are also available). Our framework makes usage of a public and documented API of Matlab, intended for external standalone applications development and extensibility (for more details, Chapter 7 of [24] can be seen), and it runs a Matlab session in the same conditions that a common user does. It requires a common Matlab installation for each user that wishes to run any application that uses this framework. Therefore, a license is needed for each active user, in the same way than in the case of using Matlab directly. For the usage of standalone applications that access Matlab through the above presented SOAP-based services, at least a group license that enables a network installation and usage may be necessary, because a Matlab session will be opened in a remote way by each running user application that access these services. In any case, and especially for a network usage, a consultation to the proprietary company about licensing requirements is obviously recommended. 5. Conclusion Local components platforms and distributed Web services can provide a powerful way to build applications from platform-independent components. In this work, a completely reusable component framework encapsulating the Matlab engine and all its functionalities has been developed. In this way, an efficient tool that allows the user for designing new and original applications is presented. The .NET technology was employed, and the C# language and the ASP.NET were used to build the framework. With the use of this platform, the reusability and portability are empowered, and the task of constructing distributed applications is highly simplified. With this work, we tried to develop a helpful tool for building applications in a simple way. We believe that our component can be useful and provide benefits when dealing with generic as well as very specific engineering tasks, such as development of educational software, modelling and sim-

E.G. Rosello´ et al. / Advances in Engineering Software 38 (2007) 256–266

266

ulation software, or neural networks software. Moreover, our component is aimed at both local and distributed applications, this allowing the user for reducing costs and time of installation and software maintenance. Future work will address to the issue of developing new and varied applications that can be easily connected to our software component framework, such as libraries dedicated to the wavelets theory, or to the performance of symbolic computations, based on the Matlab Symbolic Math toolbox. We also expect to apply this process to other CAE environments, in order to empower their reusability, and generalize our experience developing a methodology to reuse this type of environments. References [1] [2] [3] [4] [5] [6]

[7]

[8] [9] [10] [11] [12]

[13] [14]

http://www.mathoworks.com. http://www.autodesk.com. http://www.ni.com. http://www.maplesoft.com. http://ptc.COM. Campbell J, Murtagh F, Ko¨ku¨er M. DataLab-J: A signal and image processing laboratory for teaching and research. IEEE Trans Educ 2001;44:329–35. Fuller DA, Moreno AF. Experimenting with a computer-mediated collaborative interaction model to support engineering courses. Comput Appl Eng Educ 2004;12:175–88. Ando` B, Graziani S, Pitrone N. Stand-alone laboratory sessions in sensors and signal processing. IEEE Trans Educ 2004;47:4–9. Robinson JA. A software system for laboratory experiments in image processing. IEEE Trans Educ 2000;43:455–9. Pierre S, Novisser N. Reusing software components in telecommunication network engineering. Adv Eng Soft 2000;31:159–72. Sametinger J. Software engineering with reusable components. New York: Springer-Verlag; 1997. Szyperski C, Gruntz D, Murer S. Component software. beyond object-oriented programming. second ed. New York: Addison-Wesley; 2002. Heinemann GT. Component-based software engineering – putting the pieces together. Boston: Addison-Wesley; 2001. Galatopoullos DG, Funk AP, Manolakos ES. Integrating Java and Matlab components into the same parallel and distributed application using JavaPorts. In: Proceedings of the 18th international parallel and distributed processing symposium. 2004. p. 14b.

[15] Petropoulakis L, Stephen B. WebClass: software to web-enable Matlab for collaborative uses. Adv Eng Soft 2005;36:497–503. [16] Joshie SS. Development and implementation of a MATLAB simulation project for a multidisciplinary graduate course in autonomous robotics. Comput Appl Eng Educ 2004;12:54–64. [17] Kim AS, Park C, Park S-H. Development of web-based engineering numerical software (WENS) using MATLAB: applications to linear algebra. Comput Appl Eng Educ 2003;11:67–74. [18] Microsoft.NET, http://www.microsoft.com/net, 2005. [19] Lo¨wy J. Programming .Net components. second ed. O’Reilly; 2005. [20] http://www.mono-project.com. [21] http://www.w3.org/TR/SOAP. [22] Wang PS, Gray S, Kajler N, Lin D, Liao W, Zou X. IAMC architecture and prototyping: a progress report. In: Proceedings of ACM ISSAC’01. 2001. [23] Liao W, Lin D, Wang P. OMEI: an open mathematical engine interface. In: Proceedings of ASCM’2001, 5th Asian symposium on computer mathematics, 2001. [24] The Mathworks. ‘‘Matlab External Interfaces’’. Included in Matlab package documentation. Also available on-line from Mathworks website, at address http://www.mathworks.es/access/helpdesk/help/ techdoc/matlab_external/, 2006. [25] Rosello´ EG, Dacosta JG, Perez-Schofield JBG, Torres DM, Cota MP. Integrating proprietary environments as reusable components in educational software. An experience with Matlab, COM and web services. In: Proceedings of RIBIE 2004, VII Congreso Iberoamericano de Informa´tica Educativa. 2004. [26] Rosenberg DM, Reynoldson TB, Resh VH. Establishing reference conditions in the Fraser River catchments, British Columbia, Canada, using the BEAST (BEnthic Assessment of SedimenT) predictive model. In: Assessing the biological quality of fresh waters. RIVPACS and other techniques. The Freshwater Biological Association, Ambleside, June 2000. ISBN 0-900,386-62-2, 2000. [27] Rosello´ EG, Perez-Schofield JBG, M.P. Cota M, Barciela-Watts R, Sua´rez EF. An experience using computer-based interfaces to teach ecological modelling at undergraduate level. In: Proceeding of Interaction 2003, 2003. [28] Lado MJ, Me´ndez AJ, Rosello´ EG, Dacosta JG, Perez-Schofield BG, Cota MP. R-Interface: an alternative GUI for Matlab, Computer Applications in Engineering Education, in press. [29] Biggerstaff TJ. A perspective of generative reuse. Annals of Software Engineering 1998;5:169–226. [30] Rosello´ EG, Perez-Schofield JBG, Dacosta JG, Cota MP. NeuroLab: a highly-reusable software-based environment to teach artificial neural networks. Comput Appl Eng Educ 2003;11:93–102. [31] Spalter AM, van Dam A. Problems with using components in educational software. Comput Graph 2003;27:329–37.