Font Size: a A A

Design Patterns’ Research Based On Functional Programming Language

Posted on:2017-04-20Degree:MasterType:Thesis
Country:ChinaCandidate:D C LiuFull Text:PDF
GTID:2308330485462969Subject:Computer application technology
Abstract/Summary:PDF Full Text Request
Functional programming language(FP L), one of the hot research issues on software engineering, has been widely used in the development of software engineering. However, in the practice of developing FP projects, some users think that the concept of design pattern defects so that there is not necessary in FP projects to apply they; also, some users think that design patterns are still needed, but in the design field of FP projects, mostly they just copy the object-oriented method, force to imitate FP language to OOP languages, it losts a lot of outstanding characteristics of FP language, and increases the cost in implementation of design patterns, it doesn’t very good use of the characteristics of FPL. Considering these misunderstandings above, this paper do the following work for design patterns based on FP language:(1) There are three forms for traditional OOP design patterns in FP language: ① some design patterns have been absorbed by the FP language; ② some design patterns is unique in FP language;③ some design patterns are still existing in FP language, but the design and implementation details are different.(2) For the first form, research and design three design patterns: factory pattern, iterative pattern and command pattern. Such patterns have been absorbed by the FP language, can be implemented easily.(3) For the second form, by leveraging the higher-order function and closure features in FP language, design and implement the module pattern, which is easy to use and has excellent portability and reusability advantages.(4) For the third form, by improving OOP observer pattern, design and implement the publish-subscribe pattern, while design the data structure to maintain subscription channel and the AR algorithm to maintain subscription operation. Publish-subscribe pattern takes full advantage of the modular and higher-order function features in FP language, and has solved some issues in OOP observer pattern, which are circular dependency, unable accompanying data, overexposure to the observed, and adding or deleting observer actions unreasonably, and it has the advantage of 100% code reusable.(5) For the third form, by improving the OOP event-driven model, design and implement an event-driven model based on FP language and refine the model into a separate file with eight methods. Event-driven model in this paper takes full advantage of the lambda expression, higher-order function, closure and other features in FP language, has solved some issues in the OOP event-driven model, which are design complexity and codes bottleneck, it retains the advantages of the OOP event-driven model, also has the following additional advantages: easy to use, 100% code reusable, more functions and so on.(6) By applying the module pattern, publish-subscribe pattern and event-driven model in mobile game projects, supporting their advantages.
Keywords/Search Tags:Functional programming, Functional programming language, Design patterns, Event-driven model
PDF Full Text Request
Related items