2004–2008
2004–2008
Modules are software units that group together parts of different programs and knowledge (or data structures) and that usually serve a specific purpose. For any practically applied programming language modules are an essential feature, as they make large scale projects tractable by humans. Modules not only facilitate the integration of existing applications and software into complex projects, they also offer a flexible solution to application development where part of the application logic is subject to change.
The work presented in this chapter first advocates the need and advantages of modularizing rule-based languages. The rule-based paradigm offers elegant and flexible means of application programming at a high-level of abstraction. During the last couple of years, a considerable number of initiatives have focused on using rules on the Web (e.g. RuleML, R2ML, XSLT, RIF Core etc.).
However, unless these rule languages are conceived with proper support for encoding knowledge using modular designs, their contributions to the Web are arguably doomed to exist in isolation, hence with no easy mechanism for integration of valuable information. Many of the existing rule languages on the Web do not provide support for such modular designs. The rationale behind this is the focus on the initially more crucial concerns relating to the development of the languages.
The main difference between the module system presented here and previous work on module systems is, that our approach focuses on genericity. That is, the approach is applicable to many rule languages with only small adaptation to syntactic and semantic properties of the language to be supported with constructs for modularization. The concept is based on rewriting modular programs into semantically equivalent non-modular programs, hence not forcing the evaluation of the hosting language to be adapted to some operational module semantics. This approach not only enables reuseability for current languages, it is arguably also applicable to forthcoming rule languages.
The presented module system hence arguably enables reuseability in two aspects---it not only supports users of languages to design programs in a modular fashion, it also encourages tool and language architects to augment their rule languages by reusing the abstract module system.
Last but not least: the module system is easy in several aspects. First, it is very easy for language developers to apply due to the employment of reduction semantics of a given modularized rule language to its un-modular predecessor. Second, the reduction semantics is kept simple. There is just one operator, yet it is sufficient to model a quite rich modular landscape including visibility, scoped module use, parametric modules etc., though we disallow recursive modules, for reasons of simplicity. Third, the implementation of the abstract module system can be achieved using existing language composition tools, for example, Reuseware. http://reuseware.org A concrete modularized language is achieved by mere instantiation of the abstract implementation, making the implementation of the abstract module system fast and easy.
The abstract module system is then applied to extend Xcerpt with modules. Modules allow a separation of concern not just on the basis of single rules but on the basis of larger conceptual units of a query program. For example, one part of a Web application is often concerned with extracting data from a set of sources, such as a set of Web pages. At the next step, the data might have to be syndicated into a common view and format. From this syndicated data, some new implicit data could possibly be derived. Finally, the resulting data set should be displayed in an appropriate human-readable form, for example, by being displayed in a well-structured Web page (see Section sec-query-engineering for an example). These different steps taken by the application have to do with different concerns of the overall realization, such as data extraction, data management and data display. Furthermore, each of the concerns deals with different schemata, but the knowledge of the schemata can be hidden and encapsulated within each concern -- within each module. In contrast, exposing all these concerns in one monolithic query program not only becomes very hard to understand, but is also impossible to manage as a change in some part may affect any other part.
For Xcerpt, we propose a module system that (a) demonstrates how Web query languages can profit from modules by partitioning the query program as well as its execution; (b) provides an easy, yet powerful module extension for Xcerpt that shows how well-suited rule-based languages are for component-based reuse; (c) is based on a single new concept, viz.“stores”; and (d) uses a reduction semantics exploiting the power of a language with views. This semantics enables the reuse of the existing query engine making the design of the module system easier and its deployment less time consuming.
Versatile Reuse: Modules in Xcerpt
Monday, January 21, 2008
Encapsulating versatile data access: module algebra.
Prototype:
reuseware.sourceforge.net/examples/modularxcerpt.zip
Web-Demo:
—
Documentation:
st.inf.tu-dresden.de/reuseware/index.php?title=Xcerpt_example
Imprint Privacy Disclaimer |