H. Obbink and K. Pohl (Eds.): SPLC 2005, LNCS 3714, pp. 57 69, 2005. © Springer-Verlag Berlin Heidelberg 2005 Reuse without Compromising Performance: Industrial Experience from RPG Software Product Line for Mobile Devices Weishan Zhang 1 and Stan Jarzabek 2 1 School of Software Engineering, Tongji University, No. 4800 Cao’an Highway, Shanghai, 201804, China {zhangws}@mail.tongji.edu.cn 2 Department of Computer Science, School of Computing, 3 science drive 2, 117543, Singapore {stan}@comp.nus.edu.sg Abstract. It is often believed that reusable solutions, being generic, must neces- sarily compromise performance. In this paper, we consider a family of Role- Playing Games (RPGs). We analyzed similarities and differences among four RPGs. By applying a reuse technique of XVCL, we built an RPG product line architecture (RPG-PLA) from which we could derive any of the four RPGs. We built into the RPG-PLA a number of performance optimization strategies that could benefit any of the four (and possibly other similar) RPGs. By comparing the original vs. the new RPGs derived from the RPG-PLA, we demonstrated that reuse allowed us to achieve improved performance, both speed and mem- ory utilization, as compared to each game developed individually. At the same time, our solution facilitated rapid development of new games, for new mobile devices, as well as ease of evolving with new features the RPG-PLA and cus- tom games already in use. 1 Introduction Mobile games have become an important trend in the mobile phone industry. Role- Playing Game (RPG) is one kind of a mobile game suitable for mobile devices and attractive to players. With an RPG, the players take the roles of fictional characters and participate in an interactive story. All RPGs share basic Role-Playing concepts and differ in certain functional requirements. RPGs are further differentiated by the properties of a specific mobile device platform on which they run, and which affect RPG’s design and implementation. This includes high end mobile devices with 640x200 colorful screen and up to 80M memory versus lower end devices with 100x80 mono display and less than 100kb memory; the new mobile devices J2ME MIDP2.0 compliant versus the old ones MIDP1.0 enabled. RPGs must perform well across all these different devices. Given the above similarities and differences, RPGs form an interesting and poten- tially useful product line [2][4]. However, to be attractive and practical, reuse in mo- bile device, and also in embedded software sectors, must not compromise the per- formance. This problem has been frequently mentioned in many sources [5], but we