摘要
函数式编程语言在移动游戏研发中使用十分普遍,例如客户端的Lua、Java Script,服务端的Ruby、Erlang、Java Script。但目前对移动游戏开发框架的设计大多是基于传统面向对象的方法,并没有很好地利用函数式编程语言的特性。针对项目代码模块的通信问题,通过借鉴面向对象(OOP)中的观察者模式以及现有的函数式编程语言的开源框架Node.js,设计并实现一种适用于函数式编程语言的事件驱动模型FPEDM(Functional Programming Event Driven Model)。该模型具有简单易用,扩展性强,与移动游戏软件耦合度低、复用性好的特点,应用到项目开发中可大大提高开发效率,简化项目框架的复杂度。
Functional programming language (FPL) has been widely used in the development of mobile games, such as Lua and JavaScript on client, Ruby, Erlang and JavaScript on server. However, most of the designs in regard to mobile game development framework are based on traditional object-oriented method, they do not make good use of the characteristics of FPL. In this paper, focuses on the communication in modules of project code, we designed and implemented an event-driven model applicable to FPL, named FPEDM, by referring the observer pattern of object-oriented programming (OOP) and existing open source framework of FPL Node. js. The model is simple and easy to use, has strong scalability, low coupling dependency with specific mobile game projects, and good reusability. By applying it to project development, the development efficiency can be greatly improved, the complexity of the project framework can be simplified as well.
出处
《计算机应用与软件》
CSCD
2016年第9期7-9,37,共4页
Computer Applications and Software
基金
国家自然科学基金项目(61073163)
上海市企业自主创新专项资金项目(沪CXY-2013-88)
关键词
函数式编程
事件驱动模型
Functional programming Event-driven model