Language Driven Development Framework: End-to End Approach for ...

3 downloads 83183 Views 872KB Size Report
integrated language driven development (LDD) framework especially for the real time ... web application [8] approach utilizes various models at several layers ...
International Journal of Software Engineering and Its Applications Vol.8, No.3 (2014), pp.217-226 http://dx.doi.org/10.14257/ijseia.2014.8.3.20

Language Driven Development Framework: End-to End Approach for Rapid Game Server Development Hwan-Soo Yoo1 and Seong-Whan Kim2 School of Computer Science, University of Seoul, 13 iripdae-gil, Dongdaemun-gu, Seoul 130-743, Republic of Korea 1 [email protected], 2Corresponding Author: [email protected] Abstract Software programmers no longer expect to make software that only works on PCs and servers. An advantage of using DSL for their software development is that they can achieve a high efficiency compared to their development investment. However, previous research works have not conducted detailed workflow and DSL for web-development reflecting current prosperous web and mobile technology. In this paper, we propose an integrated language driven development (LDD) framework especially for the real time game server development. Using LDD framework, expert developer can make DSL language, so that novice developer or non-programmer can utilize the DSL for their easy programming works. We illustrate detailed LDD framework with our simplified game server language. With our framework, even novice programmer can program massive game server programming works during game development process, utilizing composed DSL written by expert programmer. This paper contributes to increase development productivity and ease of maintenance in game development process. Our workflow helps developers build their own language and can use in their software implementation for rapid prototyping. Using our LDD framework, many developers can build various domain applications not limited to games, including chatting applications, real-time monitoring and much more. Keywords: DSL, Language-Driven, Development method, Game, Workflow

1. Introduction Game programmers no longer make game that only works on PCs. The number of device variety such as smart phones, smart pads, smart TVs and much more are increasing at a phenomenal rate and the focus is now shifting to those devices from traditional PCs. A lot of time is spent during requirements and i mplementation phase during software development. DSL (domain-specific language) [1] refer to language designed for specific are in mind, and DSL are used for the implementation phase. An advantage of using DSL is when domain’s complexity if high, development that have used DSL have high efficiency compared to development investment. If application development team is composed of both expert and novice at a particular language, then the expert implement DSL during the beginning of the development will allow the novices to use the implemented DSL which will lead to higher productivity for the team. LDD is language driven method for game development that heavily uses and integrates DSL with game development process seamlessly. We design sophisticated framework using this method and demonstrate a simple case study. By using LDD for game development process, even non-programmer such as game designer can do prototyping

ISSN: 1738-9984 IJSEIA Copyright ⓒ 2014 SERSC

International Journal of Software Engineering and Its Applications Vol.8, No.3 (2014)

for the game during game design. Even novice programmer can shorten game development process if expert programmer make composed DSL available, thereby increasing quality by assigning time to import tasks. After this introduction, this paper is structured as follow: Section 2 reviews related work. Section 3 explains LDD process. Section 4 shows simple game serve engine case study. Section 5 summarizes the paper and outlines future work.

2. Related Works In this section, we review previous research works for frameworks for supporting rapid software development. 2.1. MDD-based Development MDD enables a method by which the programmers do not need to program all the detailed functionality they intend to implement but rather use a model to define the systems’ architecture and functions. Skeleton source code is generated from the drawn model and after composing rest of the source code, object allocation, method lookup, and exception handling constructs are used to complete the program from the written code [2]. Bernardi [3] researched approach to MDE (Model Driven Engineering) technologies enable production of a working prototype of web applications from design model and transformation technologies for different uses and domains which include XML/XSLT [4]-based languages, OMG standards based languages, ATL (ATLAS transformation languages ) [5], and many others. MOFM2T (MOF Model to Text) [6] specification defines transforming MOF models into text. Xpand framework under eclipse provides MOFM2T functionality. MDD of web applications [7] is ubiquitous web application [8] approach utilizes various models at several layers transforming into source code to arrive at final web applications. 2.2 SPL-based Development From software engineering point of view, SPL can be said to be a development methodology that maximizes software reusability and productivit y by producing various products with core assets, domain specific reusable units that have already been made for reuse. SPL is composed of core asset development, management, and product development. Software Product Line Engineering for e-Learning Applications: A Case Study [9] refactors E-learning data miner for e-learning platforms into SPL. ContextAware Autonomous Web Services in Software Product Lines[10] is Model-based Reconfiguration Engine for Web services (MoRE-WS). It uses variability models as adaption policies to automatically generate execute a plan to reconfigure web service components for SPL realization. MoRE-WS is showcased using mobile tourist planners. This product recommends places to visit using weather and location. 2.3. DSL-based Development DSLs are languages that define the jargon of a particular class of problem domains or set of domain aspects. Executable DSLs hide software implementati on [11].DSL is referred to as either domain specific language or just simply domain language but is often referred to as domain specific language by academic community. It is a limited language that is concentrated to specific problem domains by appropriate abstraction and notations. It is a problem-centric language [12] built for one particular task in mind.

218

Copyright ⓒ 2014 SERSC

International Journal of Software Engineering and Its Applications Vol.8, No.3 (2014)

Development teams use same vocabulary to represent program module. For example, if there is a requirement for bond trading module within problem domain, same vocabulary is used during code writing [13, p. 8].Kramer [14] researched mobile development DSL by supporting functions such as variables, functions, widgets, and events for deployment to iPhone, Android, and Windows Mobile phones. Funk [15] have researched using Xtext [16] and Xtend [17] for DSL to provide easy tool since image, sound, voice, and video was hard to handle for designers or content producers using existing complex tools. Furtado [18] have defined method on how to make games that operate under client using DSL, SPL, and FODA[19]. Maximilien [20] suggests that current web mashups provide a flourishing and innovative Web, but it also states that it raises new challenges, including that current mashups are point solutions, lacking principled approaches to architecture and design; and many similar mashups use the same APIs but share nothing else in common. Therefore, by using DSL, developers can also use mashups to solve Web integration and service composition problems. Masuch [21] integrated DSL into scenario-based game, and we extends it and [22] to seamlessly integrated and illustrated in detail during entire game development process . Figure 1(a) illustrates MobDSL’s architecture. It consists of 3 tiers (1) the application, written and compiled using the DSL; (2) the DSL specific engine, and implemented libraries; (3) the running platform. Figure 1(b) depicts PULP tool chain with media and script artifacts, Figure 1(c) is an extracted feature model of Arcad Ex, and Figure 1 (d) shows service mashups architecture. DSL engine takes a DSL-defined mashup and generates the code for a Ruby on Rails application.

(a)

(b)

(c)

(d)

Figure 1. (a) MobDSL Architecture, (b) PULP Scription Architecture (c) ArcadEx game feature model for DSL (d) Service Mashups Architecture using DSL

3. LDD (Language Driven Development) Integration into Game Development

for

Clear,

Concise

In this section, we propose LDD framework, which is a DSL approach for game development. It is an elaborative integration of DSL into game development process, and it can be said to be a development framework that combines DSL based domain modeling and game development process. Figure 2 shows the overall LDD framework.

Copyright ⓒ 2014 SERSC

219

International Journal of Software Engineering and Its Applications Vol.8, No.3 (2014)

To build LDD framework for game development process, we consider following major phases: (1) language requirements, (2) reference artifacts, (3) language design and compiler, and (4) legacy engine semantics. The details are as follows. 3.1. Language Requirements It is the first phase that is divided into three parts: domain artifact for analyzing the given domain’s characteristics, general language artifact for analyzing general language characteristics, and finally language requirements that combines the p revious two artifacts to form overall requirements for the language. Terminology and language found at this phase are used for DSL’s lexicon and communication in the later development and common language need to be chosen carefully. This common language is also called ubiquitous language [23, pp. 6–7]. 3.2. Reference Artifacts It is based on the information collected in the language requirement phase above and is composed of function and domain model.

Figure 2. Language Driven Development Process 3.3. Language Design and Compiler It is the defined function and domain model of the reference artifacts defined during language design phase are used to define lexicon definitions, abstract syntax, concrete syntax, and EBNF to be used in DSL being built. For internal DSL implementation, there is embedded method that uses smart API and Syntax tree manipulation and generative method that does meta-programming during compile-time and runtime. Appropriate parser generator and lexical analyzer should be chosen at compiler design stage by referring to the information presented above.

220

Copyright ⓒ 2014 SERSC

International Journal of Software Engineering and Its Applications Vol.8, No.3 (2014)

3.4. Legacy Engine Semantics It is an output that has been generated through compiler or internal code runs. These legacy engines are engines that were being used before DSL project or engines that were chosen for the project. These legacy engines need to be utilized to broaden areas that DSL is usable and lessen development effort. 4. Implementation

4. Implementation In this section, we experimented with our LDD framework to develop a HTTP game server. Developers will be able to compose appropriate applications for particular domains such as web-based application, game, chatting application, real-time monitoring and so on by using our work. Figure 3 depicts simple game server output and flow at each stage of LDD framework and language artifacts.

Figure 3. Language Driven Development Framework and Artifacts of Game Server Language Below is the partial source code for the browser-based multi-user real-time game server engine generated by such means. First line is for assigning collection using MongoDB [24], a noSQL [25] solution as an example. Second line is for assigning port for WebSocket [26] and webserver for real-time networking and HTTP. Lines 4~10 is for providing warScence.html to users joining the room and disseminating packet to participating users in the event of shooting.

Copyright ⓒ 2014 SERSC

221

International Journal of Software Engineering and Its Applications Vol.8, No.3 (2014)

1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15.

database collection is 'member' server port is 52273 … server file is 'login.html' when get '/' … server file is 'warScene.html' when get '/game/:room' socket act when 'shoot' emit 'shoot' in 'room' end … socket act when 'addroom' add room to roomList emit 'addroom' end …

With this language user can easily implement networking, database and web service feature. Without our language line 3 will be like below code. 1. app.get('/',function(request,response){ 2. fs.readFile('login.html','utf-8',function(err,data){ 3. response.writeHead(200, { 'Content-Type' : 'text/html'}); 4. response.end(data); 5. }); 6. });

4.1. Language Requirements Language requirements for real time game server is as follow. It must contain (1) general language requirements and (2) domain language requirements such as HTTP server, database and real-time networking. (1) General Language Requirements: Basic features the language must support are source code structuralization and variable scope through variable, conditional statement, and block statement. Use ‘is’, ‘isnt’ that close to natural language for supporting expression from Conditional statement. statement:

blockStatement:

inBlockStatement:

222

Copyright ⓒ 2014 SERSC

International Journal of Software Engineering and Its Applications Vol.8, No.3 (2014)

inBlock:

whenStatement:

conditionStatement:

Figure 4. BNF Diagram for General Language Feature (2) Domain Language Requirements: Use server, database, and socket that takes the form of subject for defining HTTP Server, database, and real -time network. For supporting Real-time communication and multi-user characteristics, emit, ack, disconnect, write, and send features must be provided by using easy and general language. For Database support characteristic, we provide keywords save, get, update, delete for CRUD operation. 4.2. Language Design and Compiler Word class form from natural language for subject, property, verb, preposition, and object for lexicon define rule were used and optimized and minimized lexicon definition was made. Descriptions for lexicon are as in Table 2. Abstract syntax tree was composed with CoffeeScript [27] and Jison [28] parser was used for compiler. Jison is JavaScript based parser module that is very similar to existing Bison[29] or Flex[29]. This Jison was used for language’s definition and parser.

Copyright ⓒ 2014 SERSC

223

International Journal of Software Engineering and Its Applications Vol.8, No.3 (2014)

Table 1. Language Lexicon Lexicon

Description

subject

server, database, socket

server property

port, file, log, message, redirection, download File

database property

collection

preposition

in, to, from

server verb

response, get, post, is

network verb

join, add, emit, leave, disconnect, ack, send, write

database verb

save, delete, update, get

conditional statement

when, is, isnt

block statement

act, end

Partial BNF for language is as Figure 4. It shows general statement, block statement, server’s ‘when’ statement, and conditional statement. languageΔ statement blockStatement inBlockStatement inBlockSentence whenStatement conditionStateme nt

→ statement* → subject verb object preposition+ whenStatement+ | block_statement inBlockStatement → server act whenStatement | socket act when object → inBlockSentence* end → response serverProperty verb object whenStatement+ | response+ verb object preposition+ whenStatement+ → when [ get+ | post+ ] [ object | conditionStatement ] → object [ is | isnt ] object

Figure 5. Partial BNF for Language Compiler is composed of syntactical analyzer and transcoder as in Figure 3. Syntactical analyzer is formed of (1) lexicon parser that takes the processing rule as input and processes syntax, (2) AST handler that processes semantics, (3) stack handler that processes push and pop operation statement, and (4) array handler. Transcoder is composed of skeleton generator that generates stub code necessary for the operation of server that has been made with our language, server generator for the generation of typical server element code, Web generator for HTTP and Express side generation, General code generator for general language feature, and Code aggregator that collects the codes mentioned. 4.3. Legacy Engine Semantics Output that has been generated through compiler operates on top of the legacy engine. Node.js is used for server engine and Socket.IO is used for real -time networking server engine. Express for Web engine, MongoDB for database engine, and MongoJS for MongoDB and Express integration.

224

Copyright ⓒ 2014 SERSC

International Journal of Software Engineering and Its Applications Vol.8, No.3 (2014)

5. Summary and Conclusion LDD based development provides the procedures for building DSL during game development. DSL produced from this procedure is easily usable by non-experienced in game programming and suggests convenience and reusability not realizable in the traditional development. This framework encompasses from language requirement to design, textual language compiler and deployment to legacy engines and is applicable to various domains. Examples of such domain is: Given that the task is to build widely used real-time network application server in use by existing games, game planner or non-expert developer can easily do database handling and network communication that are difficult to handle using existing languages by using DSL that have been constructed through LDD. Also, there are a lot of demand for inter -disciplinary related works which have caused media art designer to do programming also, at which they use processing language[30] primarily for the task. Media art designer can efficiently express what they intend with little amount of code by using the DSL produced by domain experts by LDD approach instead of the aforementioned language.

References [1] [2] [3]

[4] [5] [6] [7] [8]

[9]

[10] [11]

[12] [13] [14]

[15] [16]

M. Mernik, J. Heering and A. M. Sloane, “When and how to develop domain-specific languages”, ACM Comput. Surv. CSUR, vol. 37, no. 4, (2005), pp. 316-344. K. Balasubramanian, A. Gokhale, G. Karsai, J. Sztipanovits and S. Neema, “Developing applications using model-driven design environments”, Computer, vol. 39, no. 2, (2006) February, pp. 33-40. M. L. Bernardi, G. A. Di Lucca and D. Distante, “A model-driven approach for the fast prototyping of Web applications”, Web Systems Evolution (WSE), 2011 13th IEEE International Symposium on , (2011), pp. 65-74. C. James, “Xsl transformations (xslt)”, 1999. [Online]. Available: http://www. w3. org/TR/xslt. [Accessed: 15-Oct-2013]. F. Jouault and I. Kurtev, “Transforming models with ATL”, Satellite Events at the MoDELS 2005 Conference, (2006), pp. 128-138. OMG, “MOF Model to Text Transformation Language (MOFM2T), 1.0,” 2008. [Online]. Available: http://www.omg.org/spec/MOFM2T/1.0/. [Accessed: 15-Oct-2013]. D. Distante, P. Pedone, G. Rossi and G. Canfora, “Model-driven development of web applications with UWA, MVC and JavaServer faces”, Web Engineering, Springer, (2007), pp. 457–472. A. Finkelstein, A. Savigni, G. Kappel, W. Retschitzegger, E. Kimmerstorfer, W. Schwinger, T. Hofer, B. Pröll and C. Feichtner, “Ubiquitous web application developmen t-a framework for understanding”, 6th World Multiconference on Systemics, Cybernetics and Informatics, (2002), pp. 431-438. P. Sanchez, D. Garcia-Saiz and M. Zorrilla, “Software product line engineering for e-learning applications: A case study”, Computers in Education (SIIE), 2012 International Symposium, (2012), pp. 1-6. G. H. Alferez and V. Pelechano, “Context-Aware Autonomous Web Services in Software Product Lines”, (2011), pp. 100-109. F. P. Stappers, S. Weber, M. A. Reniers, S. Andova and I. Nagy, “Formalizing a domain specific language using SOS: an industrial case study”, Software Language Engineering, Springer, (2012), pp. 223-242. B. Langlois, C.-E. Jitia and E. Jouenne, “DSL classification”, OOPSLA 7th Workshop on Domain Specific Modeling, (2007). D. Ghosh, DSLs in action. Greenwich, Conn.: Manning, (2011). D. Kramer, T. Clark and S. Oussena, “MobDSL: A Domain Specific Language for mult iple mobile platform deployment”, Networked Embedded Systems for Enterprise Applications (NESEA), 2010 IEEE International Conference on, (2010), pp. 1-7. M. Funk and M. Rauterberg, “PULP scription: a DSL for mobile H TML5 game applications”, Entertainment Computing-ICEC 2012, Springer, (2012), pp. 504-510. B. Heiko, C. Michael, E. Sven, E. Moritz, F. Peter, K. Jan, W. Knut and Z. Sebastian, “Xtext User Guide”, Eclipse Foundation, (2010).

Copyright ⓒ 2014 SERSC

225

International Journal of Software Engineering and Its Applications Vol.8, No.3 (2014)

[17] E. Sven and Z. Sebastian, “Xtend,” [Online]. Available: http://www.eclipse.org/xtend/ documentation.html, (2011). [18] A. W. Furtado, A. L. Santos and G. L. Ramalho, “Digital Games Development Automation through Domain-Specific Languages: an End-to-End Approach”, Presented at the SBLP 2008, (2008). [19] M. Riebisch, “Towards a more precise definition of feature models”, Model. Var. Object-Oriented Prod. Lines, (2003), pp. 64-76. [20] E. M. Maximilien, A. Ranabahu and K. Gomadam, “An online platform for web apis and service mashups”, Internet Comput. IEEE, vol. 12, no. 5, (2008), pp. 32-43. [21] R. Walter and M. Masuch, “How to integrate domain-specific languages into the game development process”, Proceedings of the 8th International Conference on Advances in Computer Entertainment Technology, (2011), pp. 42. [22] Y. Hwan-Soo and K. Seong-Whan, “Simplified Game Specific Description Language for Rapid Game Server Development using LDD (Language Driven Development) Framework”, Advanced Science and Technology Letters, vol. 39 (Games and Graphics 2013), (2013), pp. 123-130. [23] M. Fowler, Domain-specific languages. Upper Saddle River, NJ: Addison-Wesley, (2011). [24] K. Chodorow and M. Dirolf, “MongoDB: the definitive guide”, Beijing; Farnham: O’Reilly, (2010). [25] N. Leavitt, “Will NoSQL databases live up to their promise?”, Computer, vol. 43, no. 2, (2010), pp. 12-14. [26] I. Fette and A. Melnikov, “The WebSocket Protocol”, 2011. [Online]. Available: http://tools.ietf.org/html/draft-ietf-hybi-thewebsocketprotocol-17. [Accessed: 04-Sep-2013]. [27] T. Burnham, “Coffeescript: accelerated Javascript development”, Dallas, Tex.: Pragmatic Bookshelf, (2011). [28] C. Zach, “Jison”, 2013. [Online]. Available: http://zaach.github.io/jison/. [Accessed: 22 -Sep-2013]. [29] J. R. Levine, Flex & bison. Sebastopol, Calif.: O’Reilly Media, (2009). [30] C. Reas and B. Fry, “Processing: a programming handbook for visual designers and artists ”, Cambridge, Mass.: MIT Press, (2007).

Authors Hwan-Soo Yoo, is a Ph.D. candidate in computer science at the University of Seoul. From 1998 to 2008, he worked at Telecommunication software development company on Internet browser, SMSC (Short message system center) server, LBSC (Location-based system center) server and mobile game platform. His current research focuses on web-based multimedia authoring system, multimedia system development using domain specific language.

Seong-Whan Kim, received his Ph.D. degree in EECS from KAIST, in 1999. He has worked for IMT-2000 infrastructure division as a software team leader in LG Electronics from 1997 to 2000, and involved in wireless LAN infrastructure design team as a senior software engineer in Cisco Systems from 2000 to 2001. He is currently a full professor at the school of computer science, University of Seoul, Seoul, Korea. His research interests include mobile communication systems, mathematical modeling of human visual system, and its application to multimedia.

226

Copyright ⓒ 2014 SERSC

Suggest Documents