. .
Hypermedia Patterns and Components for Building better Web Information Systems Martin Gaedke
Fernando Lyardet Hans-Werner Gellersen Telecooperation Office (TecO), University of Karlsruhe Lifia, Dto. de Informática, Fac. de Cs. Exactas, University of La Plata Telecooperation Office (TecO), University of Karlsruhe [email protected] [email protected] [email protected] Introduction In this paper we present how the integration of design patterns into a componentbased model of implementation such as WebComposition, provide a better infraestructure to allow a smooth transition from design to implementation, higher quality applications, and heavier implementation reuse. The WebComposition approach The use of software engineering knowledge for web application development is being complicated by its coarse-grained model. This model fit well for its originally intended use that was enabling authors especially researches to provide and maintain their content respectively their research results. The use of the web has changed dramatically during the last years and has established a new kind of application domain. Today, web application development suffers from the coarse-grained web implementation model. The implementation model prevents reuse of design knowledge yielding in cost-intensive applications and difficulties for quality improvements. As the number of technologies involved within the development of new web applications with better services is growing endlessly, developers are forced to deal with technology interactions and maintenance that are more complex. The WebComposition approach aims at this problem by introducing a simple object-oriented model, which acts as an intermediate model between a design-model and the coarse-grained web implementation model. The model allows a seamless possibility of using well-known software engineering concepts by automating the mapping of the design model entities to the web implementation. The following sections will introduce M. Gaedke, F. Lyardet, H.-W. Gellersen: Hypermedia Patterns and Components for Building better Web Information Systems. Proceedings of the Hypertext99 (HT99) Workshop on Hypermedia Development - Design Patterns in Hypermedia, Darmstadt, Germany, 1999 2 the WebComposition model and an object-oriented web implementation technology, called the WebComposition Markup Language. The WebComposition Model In WebComposition, web entities are modeled as component objects with a state and a set of operations specifying the component behavior. Components can model web entities with respect to a variety of target languages and of arbitrary granularity, i.e. links, anchors, layout fragments, or even complete pages, scripts, or groups of resources. Components can reference other components to model aggregation (has-part relationship) or specialization (inherits-from relationship). WebComposition is based on a prototype-instance OO model, cf. [15], as opposed to a class-oriented OO model, which we considered too heavy. Components may be used like an abstract class, i.e. as a prototype for certain components. Prototyping is a mechanism to implement code sharing among objects. Another possibility to share the code of a component is to allow multiple references on the same component. Sharing is fundamental to reuse and for maintainability as it helps keeping modifications local. The WebComposition System, which implements the model, is based on two main architectural elements: The Component Store and the Resource Generator. The Component Store represents the model by storing all components in a persistent way and enabling tools and the Resource Generator to access or manipulate them. The Resource Generator creates resources from the component model of a web application. The mapping is facilitated by the components’ implementation service, which depends on how the Component Store is implemented. Starting from a root component, the implementation service is invoked top-down from composite components to atomic components. The resource generator can perform both a complete installation and an incremental update of a web application. This architecture is fundamental for a seamless integration into existing infrastructures. The WebComposition implementation model may be implemented or used in different ways, like modeling components as functions or as described in [7] as objects of a relational database. In the following section we will introduce the WebComposition Markup Language, which we invented as implementation technology that supports component reuse based on the platform independent XML-standard. The WebComposition Markup Language (WCML) The WebComposition Markup Language is an application of the XML enabling web engineers to reuse designs and code fragments by providing a simple notation that is capable of defining objects and their relationships. Components described in WCML reside in a WCML document, which we refer to as a virtual component store, in conformity to the WebComposition system described in [7]. In the following sections, M. Gaedke, F. Lyardet, H.-W. Gellersen: Hypermedia Patterns and Components for Building better Web Information Systems. Proceedings of the Hypertext99 (HT99) Workshop on Hypermedia Development - Design Patterns in Hypermedia, Darmstadt, Germany, 1999 3 we introduce the WebComposition Markup Language in short. Like all XML documents a WCML document consists of a prolog and the content containing the markup. The document is processed by the WCML compiler mapping the described components of the Virtual Component Store to the Web implementation model respectively the target language. Thus, the tasks of the WCML compiler are to accomplish the presentation operation for the components and to resolve the different properties including links. In figure 1, the integration of the WCML compiler with the existing system is depicted. Fig. 1: Integration and Processing of WCML The main goal to provide a possibility that enables web engineers to reuse objectoriented design and code or develop code for reuse is accomplished by using XML. The components are provided by WCML documents (XML-based description) accessible through the file system, a database system, or for distributed development support through a Web server. In the following step, the WCML document is parsed by the WCML parser respectively an XML parser. The resulting parser-tree is then evaluated to resolve the relationships of the components. It is obvious here that the WCML-system remains transparent for the existing web infrastructure. According to the WebComposition Model, a WCML document consists of different component declarations, as given by the WCML DTD, with their properties and their relationships defined by inheritance and aggregation, as shown in the following code fragment: 7 M. Gaedke, F. Lyardet, H.-W. Gellersen: Hypermedia Patterns and Components for Building better Web Information Systems. Proceedings of the Hypertext99 (HT99) Workshop on Hypermedia Development - Design Patterns in Hypermedia, Darmstadt, Germany, 1999 4 3 In the above example, component c2 inherits the properties x and y of c1. By redefining property y to the new value 7 in c2, the former binding is obsolete. The example demonstrates the definition of fine-granular objects embedded in Markup Code. WCML introduces special properties to take care of hypertext functionality. The Linkproperty allows the definition of relationships between components on a conceptual level. The Compiler maps the link properties to the corresponding hypertext links. For example, a property href: will be resolved to a value like filename.html#c1.c3 giving web engineers the freedom to model linking between components without considering filename and directory structures, which may be defined by another person. In the above example, the property href indicates a link to the anchor for the component c3, which resides in the content of component c1. The necessary HTML tags with its attributes must be provided by the referring component, as the target language is not determined. The benefit of modeling the hypertext links in this way is the possibility to define the links outside the components and thus to redefine a navigation structure or even define multiple navigation structures for the same components without modifying any of them. The Decorator Pattern As demonstration, we present a WCML application that reuses the content for different target languages. Further, the implementation is built reusing the design concept of the Decorator Pattern [5]. The intent of a decorator is to provide a flexible alternative to subclassing for extending functionality. Relating to a web site the idea of a decorator can be adopted to easily add different views on one existing content. The following figure 2 shows how the application profits from the decorator used for navigation and layout. The separation achieved by the application of the decorator pattern allows a better information management by allowing the definition of Navigational Contexts[13]. Contexts as described in OOHDM methology help to organize nodes in such a way that sets of similar nodes can be easily traversed and allowing one node to belong to different sets and be focused differently according to the context in which it is accessed. As a result, authors are no longer tied-up to a tree-based structure for their websites, since it is possible to group nodes in meaningful sets without repetition of information. Finally, navigational contexts allows to stablish which information will be perceived by the users, according to certain criteria. M. Gaedke, F. Lyardet, H.-W. Gellersen: Hypermedia Patterns and Components for Building better Web Information Systems. Proceedings of the Hypertext99 (HT99) Workshop on Hypermedia Development - Design Patterns in Hypermedia, Darmstadt, Germany, 1999 5 Fig. 2: Decorator use for Navigation and Layout The following WCML-example shows how application development, maintenance, and evolution facilitate from the idea of the Decorator Pattern. …Content to provide… The above code separates resources, layout, and content. The resources are defined by the top-level Page1-component, which defines the name of the component in the filesystem of the web server, further the PageStyle1-component determines that the layout defined by itself should be used in a special directory. Finally, the PlainContentcomponent represents the content to provide by the web server. Adding components that implement a Decorator influences the flexibility of the complete application. The layout respectively the representation of the content is determined in one local place, given by the DecoratorExample-Component: M. Gaedke, F. Lyardet, H.-W. Gellersen: Hypermedia Patterns and Components for Building better Web Information Systems. Proceedings of the Hypertext99 (HT99) Workshop on Hypermedia Development - Design Patterns in Hypermedia, Darmstadt, Germany, 1999 6 By simply changing the inheritance-relationship of the Page1 component from PageStyle1 to the new PageStyle2 integrates the Decorator implementation. By this modification the Page1 component inherits the behavior of the PageStyle2 component, which is responsible for targeting the content at the right directory and displaying the content (as done before by PageStyle1-component). The Page1 component itself references the component that should be displayed by definition of the property display.component. Finally, the Decorator adds layout behavior by embedding the content in a table. Other decorators can easily be added without redefining the main information defined by the PlainContent component. Availability The WCML-compiler is available at: http://www.teco.edu/~gaedke/webe/ Bibliography [1] R.A. Barta and M.W. Schranz, JESSICA: an object-oriented hypermedia publishing processor. In Computer Networks and ISDN Systems 30(1998), Special Issue on the 7th Intl. World-Wide Web Conference, Brisbane, Australia, April 1998, 239-249. [2] F. Coda, C. Ghezzi, G. Vigna and F. Garzotto. Towards a Software Engineering Approach to Web Site Development. In Proceedings of 9th International Workshop on Software Specification and Design (IWSSD). April 16-18 1998, Ise-shima, Japan. M. Gaedke, F. Lyardet, H.-W. Gellersen: Hypermedia Patterns and Components for Building better Web Information Systems. Proceedings of the Hypertext99 (HT99) Workshop on Hypermedia Development - Design Patterns in Hypermedia, Darmstadt, Germany, 1999 7 [3] M. Gaedke, M. Beigl, H.W. Gellersen: Mobile Information Access: Catering for Heterogeneous Browser Platforms. Workshop on Mobile Data Access at the 17th International Conference on Conceptual Modeling (ER98), Singapore, November 16-19, 1998. [4] M. Gaedke, H.W. Gellersen, A. Schmidt, U. Stegemüller, W. Kurr. Objectoriented Web Engineering for Large-scale Web Service Management. Thirty-Second Annual Hawaii International Conference On System Sciences (HICSS-32) on the Island of Maui, USA, January 5 - 8, 1999. [5] E. Gamma, R. Helm, R. Johnson and J. Vlissides. Design Patterns: Elements of Reusable Object-Oriented Software, Addison-Wesley, 1994. [6] H.W. Gellersen and M. Gaedke: An Object-Oriented Model (not only) for Hypertext in the Web. HTF5: The Fifth International Workshop on Engineering Hypertext Functionality into Future Information Systems, The 20th International Conference on Software Engineering, Kyoto International Conference Hall, Kyoto, JAPAN, April 1998. [7] H.-W. Gellersen, R. Wicke and M. Gaedke. WebCompostion: an object-oriented support system for the Web engineering lifecycle, Computer Networks and ISDN Systems 29 (1997), Special Issue on the 6th Intl. World-Wide Web Conference, Santa Clara, CA, USA, April 1997, 1429-1437. [8] T. Isakowitz, E.A. Stohr and P. Balasubramaninan. RMM: A Methodology for Structured Hypermedia Design, Communications of the ACM, August 1995. [9] Kristensen, A. Tempate resolution in XML/HTML. In Computer Networks and ISDN Systems 30(1998), Special Issue on the 7th Intl. World-Wide Web Conference, Brisbane, Australia, April 1998, 239-249. [10] K. Larson and M. Czerwinski. Web Page Design: Implications of Memory, Structure and Scent for Information Retrieval, In Proceedings of CHI ’98, Human Factors in Computing Systems (LA, April 21-23, 1998), ACM press, 25-32. [11] F. Lyardet, G. Rossi and D. Schwabe. Using Design Patterns in Educational Multimedia applications. In Proceedings of ED-Media'98, World Conference on Educational Multimedia and Hypermedia, Freiburg, Germany, June 1998. [12] G. Rossi, A. Garrido and S. Carvalho. Design Patterns for Object-Oriented Hypermedia Applications. In: Pattern Languages of Programs 2, Vlissides, Coplien and Kerth (eds.), Addison-Wesley, 1996. [13] D. Schwabe, G. Rossi and S. Barbosa. Systematic Hypermedia Design with OOHDM. In Proceedings of the ACM International Conference on Hypertext, Hypertext '96, Washington, March 1996. [14] I. Sommerville. Software Engineering, 4th Edition, Addison Wesley. M. Gaedke, F. Lyardet, H.-W. Gellersen: Hypermedia Patterns and Components for Building better Web Information Systems. Proceedings of the Hypertext99 (HT99) Workshop on Hypermedia Development - Design Patterns in Hypermedia, Darmstadt, Germany, 1999 8 [15] D. Ungar and R.B. Smith. Self: The Power of Simplicity, OOPSLA ’87 Proceedings, p. 227-42, 87. [16] World-Wide Web Consortium. XML: eXtensible Markup Language. http://www.w3c.org/XML/ About the Authors Martin Gaedke received the MSc degree in computer science in 1997 from the University of Karlsruhe/Germany. Since 1997, he has been with the Institute for Telematics as Research Assistant. His research interests include web engineering, component-based software engineering, software reuse, automated code generation, and software measurement. Telecooperation Office (TecO), University of Karlsruhe Vincenz-Prießnitz-Str. 1, 76131 Karlsruhe, Germany http://www.teco.edu/~gaedke/ Ph.: +49 (721) 6902-79, Fax: +49 (721) 6902-16 Fernando Lyardet has been working in the fields of hypermedia and object orientation since 1992, first as a development group member and later as member of the research team at LIFIA. While his focus is on the design methodology and design patterns for hypermedia systems. Other topics of study are application framewoks. Hans-W. Gellersen obtained a doctoral degree from the University of Karlsruhe in 1996, and since has been leading the Telecooperation reserach group (TecO). He teaches Distributed Multimedia Systems in Karlsruhe, and serves on the editorial board of Personal Technologies. His research interest is in web engineering, and in innovative applications of mobile and ubiquitous computing technologies. Telecooperation Office (TecO), University of Karlsruhe Vincenz-Prießnitz-Str. 1, 76131 Karlsruhe, Germany http://www.teco.edu/~hwg/ Ph.: +49 (721) 6902-49, Fax: +49 (721) 6902-16 Suggest Documents |