Context. Features and styles inspired by functional programming have grown in popularity in the world of object-oriented programming. Immutability is a core concept of functional programming, which brings advantages t...
详细信息
ISBN:
(纸本)9798400700408
Context. Features and styles inspired by functional programming have grown in popularity in the world of object-oriented programming. Immutability is a core concept of functional programming, which brings advantages to software development. However, introducing immutability in object-oriented programming presents some challenges. Problem. One of these challenges is method overriding. When inheriting non-destructive mutators (methods used on immutable objects which return a new object instead of modifying the receiver), a naive approach generates code duplication and has scalability issues. Contribution. We analyse an example of this overriding problem and propose a solution in a new design pattern based on the factory method pattern. We also discuss the advantages and limitations of this pattern, as well as implementations in Clojure, Java, and Kotlin. We also identify and discuss the language features that mostly affect the implementation of this pattern. Conclusion. Our proposed design pattern helps mitigate some of the code duplication and scalability problems of a naive approach. However, the inclusion of a functional updating language feature is required to completely remove the scalability issues.
Despite enduring criticisms spanning several decades, jump statements such as goto, break, continue, and return remain prevalent in imperative programming languages, including but not limited to C++, Java, and Python....
详细信息
ISBN:
(纸本)9798400708688
Despite enduring criticisms spanning several decades, jump statements such as goto, break, continue, and return remain prevalent in imperative programming languages, including but not limited to C++, Java, and Python. The academic community has yet to reach a consensus regarding whether the refactoring of source code in these languages to eliminate such statements can indeed enhance code readability. Nevertheless, it is evident that automated program analysis would derive substantial benefits from this refactoring, given that structured code analysis is more straightforward than analyzing code that exhibits capricious alterations in its control flow. While algorithms tailored for this refactoring process have been proposed for certain imperative languages, we introduce a congruent algorithm, specifically designed for a dataflow programming language. It’s important to note that although dataflow languages lack jump statements, they might incorporate jump-objects (in object-oriented contexts) or jump-functions (within functional paradigms). Our algorithm has been instantiated as a command-line tool tailored for refactoring EO, an object-oriented dataflow language. Preliminary tests with several EO programs have validated the tool’s efficacy. Leveraging φ -calculas, we provide a formal proof underscoring the validity of every transformation encompassed within our algorithm.
The use of electronic technology in on-line learning is increasing, that is facilitating teaching and learning for both teacher and students. Nowadays the traditional object-oriented programming teaching does not adap...
详细信息
The use of electronic technology in on-line learning is increasing, that is facilitating teaching and learning for both teacher and students. Nowadays the traditional object-oriented programming teaching does not adapt to the needs of teaching and learning. So we construct the on-line platform of object-oriented programming to meet the needs of on-line tutoring, the assessment and examination paper analysis for teaching, at the same time helping the students' on-line learning and testing. It is a reference model for teaching and learning on the Internet.
This paper is dedicated to the features of the software component of the memory test setup based on the object-oriented approach in LabVIEW environment. The specificities of the software development for test setups us...
详细信息
ISBN:
(纸本)9781728185040
This paper is dedicated to the features of the software component of the memory test setup based on the object-oriented approach in LabVIEW environment. The specificities of the software development for test setups used for the control of the electronics device's parameters are described. The paper concerns the advantages and disadvantages of the object-oriented approach in the software development process in LabVIEW and the challenges which may arise during the remodeling of the program written in the procedure programming paradigm using the object-oriented methodology. The actor model is described as well as its modification made for use in the developed software solution. Reasons that necessitated modification of the standard actor model are discussed. The specific features of the architecture of the developed software are described. Solutions aimed at building a universal program project are presented;they ensure that minimal adaptation is needed to perform functional and parametric control of any memory device. Among these solutions are the universal interface between the program executed on PC and the program responsible for the high-speed input and output executed on programmable logic device (PLD). For various architectures of the program executed on PLD there was conducted a comparison of the hardware resources used and a compilation time.
In the field of ecoinformatics, synthetic ecologies approach intends to reproduce in silico the architecture and functioning of a real domain 'as it works'. When the systems to be represented are complex, bioi...
详细信息
ISBN:
(纸本)9789897585289
In the field of ecoinformatics, synthetic ecologies approach intends to reproduce in silico the architecture and functioning of a real domain 'as it works'. When the systems to be represented are complex, bioinspiration is proposed as a relevant approach to develop robust modelling. This study aims to develop, using basic object-oriented paradigms, and in collaboration with biologists, a comprehensive synthetic ecology about a given application domain: wild rodents' population dynamics. To address the complexity of the field, the architecture is gradually grown and shaped from integration of successive and diverse case studies modelling in the application domain. Developed for more than ten years, the same model has made it possible to represent historical, cellular and/or ecological processes at the scales of a country, a region, a city or a laboratory as well as a diversity of interacting living beings. Results present how principles such as composition, aggregation, inheritance, generalization have been used to elaborate a synthetic ecology. These paradigms altogether constitute a rich, and improvable, toolbox offering a varied set of possible uses to formalize bioinspired landscape or ecologies.
Detecting programming errors and vulnerabilities in software is increasingly important, and building tools that help developers with this task is a crucial area of investigation on which the industry depends. In objec...
详细信息
ISBN:
(纸本)9783030781415;9783030781422
Detecting programming errors and vulnerabilities in software is increasingly important, and building tools that help developers with this task is a crucial area of investigation on which the industry depends. In object-oriented languages, one naturally defines stateful objects where the safe use of methods depends on their internal state;the correct use of objects according to their protocols is then enforced at compile-time by an analysis based on behavioral types. We present Java Typestate Checker (JATYC), a tool based on the Checker Framework that verifies Java programs with respect to typestates. These define the object's states, the methods that can be called in each state, and the states resulting from the calls. The tool offers the following strong guarantees: sequences of method calls obey to object's protocols;completion of objects' protocols;detection of null-pointer exceptions;and control of the sharing of resources through access permissions. To the best of our knowledge, there are no research or industrial tools that offer all these features. In particular, the implementation of sharing control in a typestate-based tool seems to be novel, and has an important impact on programming flexibility, since, for most programs, the linear discipline imposed by behavioral types is too strict. Sharing of objects is enabled by means of an assertion language incorporating fractional permissions;to lift from programmers the burden of writing the assertions, JATYC infers all of these by building a constraint system and solving it with Z3, producing general assertions sufficient to accept the code, if these exist.
Technology is becoming a major part of each individual's life. The modern society is saturated with technology and cannot be separated from technology. Now a days, every person is using many number of devices and ...
详细信息
ISBN:
(纸本)9781665400916
Technology is becoming a major part of each individual's life. The modern society is saturated with technology and cannot be separated from technology. Now a days, every person is using many number of devices and systems. Code Vision is a mobile application which is created for e-learning purposes. So we are emerging entertainment and education together for students to learn programming language. The aim of this article is to illustrate the leaning mobile application which is based on animated dry run of programming language C++ and object-oriented programming. It is based on the basic and advance concepts of OOP and C++. Mostly people face problems like they could not be able to understand the working of programming when they initially start learning, they won't be able to create the logic of their own program. This application reduces the confusion factor and make all the concepts clear in people's mind. In this article, the development process of this application has been described, and also the functionalities and significance of requirements of this application is defined. This article will be helpful in further researches and development in the field of mobile application development.
Many visualisation tools have been designed to help students with learning programming concepts, often showing positive impact on student performance. Analogies have also often been used to assist in teaching students...
详细信息
ISBN:
(纸本)9781450389761
Many visualisation tools have been designed to help students with learning programming concepts, often showing positive impact on student performance. Analogies have also often been used to assist in teaching students various programming concepts, and have similarly shown to boost student confidence of the concepts. Less work has been done to specifically target polymorphism, and the misconceptions students face with it. This study presents the design of a new visualisation tool along with its supporting analogy. It aims to assist in teaching the concept of polymorphism to students, along with correcting the misconceptions students have when dealing with this concept. Experiences using the tool for a CS2 OOP course are presented, including engagement logs and student feedback. The paper concludes with findings of this experience, discussing directions for future work in this area.
In recent times, the subject of interoperability has become very popular. In large-scale software applications development, it is a common practice to combine multiple languages in solving peculiar problems and develo...
详细信息
In recent times, the subject of interoperability has become very popular. In large-scale software applications development, it is a common practice to combine multiple languages in solving peculiar problems and developing robust solutions. The ability to combine multiple languages allows an easy migration of an existing project from one language to another or use existing libraries in another language. This makes interoperability a force to be reckoned with when developing new programming languages. The Eolang programming language is a new research and development initiative aimed at achieving true object-oriented programming by having all components of the program as objects. As such, the construct and syntax of Eolang is vastly different from that of Java. This makes integration and interoperability between these two languages a challenging issue related to method/object naming conventions, keywords and operators, etc. In this paper we explore the potential of Eolang interoperability with Java by looking at the interoperability mechanisms of some other languages with Java, describe ways to overcome these challenges with Eolang and develop the solution. Specifically, we focus on the possibility to call Java code from Eolang while the semantics of both languages remain preserved. Our solution allows Java code to be called in Eolang through wrappers that turn Java classes and methods into Eolang objects. (C) 2021 The Authors. Published by Elsevier B.V. This is an open access article under the CC BY-NC-ND license (https://***/licenses/by-nc-nd/4.0) Peer-review under responsibility of the scientific committee of KES International.
Programmable accelerators aim to provide the flexibility of traditional CPUs with significantly improved performance. A wellknown impediment to the widespread adoption of programmable accelerators, like CPUs, is the s...
详细信息
ISBN:
(纸本)9781450383172
Programmable accelerators aim to provide the flexibility of traditional CPUs with significantly improved performance. A wellknown impediment to the widespread adoption of programmable accelerators, like CPUs, is the software engineering overhead involved in porting the code. Existing support for C+ + on GPUs allows programmers to port polymorphic code with little effort. However, the overhead from the virtual functions introduced by polymorphic code has not been well studied or mitigated on CPUs. To alleviate the performance cost of virtual functions, we propose two novel techniques that determine an object's type based only on the object's address, without accessing the object's embedded virtual table pointer. The first technique, Coordinated object Allocation and function Lookup (COAL), is a software-only solution that allocates objects by type and uses the compiler and runtime to find the object's vTable without accessing an embedded pointer. COAL improves performance by 80%, 47%, and 6% over contemporary CUDA, prior research, and our newly-proposed type-based allocator, respectively. The second solution, TypePointer, introduces a hardware modification that allows unused bits in the object pointer to encode the object's type, improving performance by 90%, 56%, and 12% over CUDA, prior work, and our new allocator. TypePointer can also be used with the default CUDA allocator to achieve an 18% performance improvement without modifying object allocation.
暂无评论