Server pages (also called dynamic pages) render a generic web page into many similar ones. The technique is commonly used for implementing web application user interfaces (UIs). Yet our previous study found a high rate of repetitions (also called 'clones') in web applications, particularly in UIs. The finding raised the question as to why such repetitions had not been averted with the use of server pages. For an answer, we conducted an experiment using PHP server pages to explore how far server pages can be pushed to achieve generic web applications. Our initial findings suggested that generic representation obtained using server pages sometimes compromises certain important system qualities such as run-time performance. It may also complicate the use of WYSIWYG editors. We have analysed the nature of these trade-offs, and now propose a mixed-strategy approach to obtain optimum generic representation of web applications without unnecessary compromise to critical system qualities and user experience. The mixed-strategy approach applies the generative technique of XVCL to achieve genericity at the meta-level representation of a web application, leaving repetitions to the actual web application. Our experiments show that the mixed-strategy approach can achieve a good level of genericity without conflicting with other system qualities. Our findings should open the way for others to better-informed decisions regarding generic design solutions, which should in turn lead to simpler, more maintainable and more reusable web applications.
INTRODUCTIONServer pages (also called dynamic pages) are commonly used to implement web application user interfaces (UIs). ASP, JSP and PHP are typical examples of web technologies that use some form of server pages. A server page is a combination of HTML and programming language scripts, which the web server uses to generate web pages dynamically at run time. Therefore, a server page can represent many similar web pages in a generic form.Our previous study [1] revealed a high level of repetitions in the domain of web applications. We analysed 17 web applications of different sizes, developed using different technologies and in different application domains. We found a higher incidence of clones in web applications as compared with traditional applications, particularly in the UI area. It is tempting and often useful to represent such clones in a unique, generic form for a number of reasons. Such unification reduces the size and the cognitive complexity of a software solution. It explicates dependencies among program parts that contain clones, and reduces the chance of update anomalies. The C++ standard template library (STL) is a powerful example of simplifications and engineering benefits achievable from a skillfully designed generic representation. While techniques used to achieve genericity of STL may not be equally effective in other domains, generative techniques can provide more versatile solutions to the generic design problem [2][3][4][5].This paper presents an experiment we have...