scholarly journals Generic Ownership Types for Java and the Collections Framework

2021 ◽  
Author(s):  
◽  
Ahmed Aziz Khalifa

<p>Generic programming has turned out very useful in the development of reusable software. With the Java programming language, genericity is not only meant for reusability, but also for type-safety. Java generics constrain a container object (e.g., list, hash table) to store objects of a pre-specified data type. Nevertheless, safe programming with aliasing (multiple pointers in a program may point to the same object) is still a concern in object-oriented programming language research. A pointing object can mutate the state of the aliased object, reflecting the changes to all of the other pointers (aka aliases) thus affecting their behaviour. As programs grow larger and more complex, such changes in behaviour can be undesirable and difficult to detect and reason about. With respect to container objects, the iterator pattern critically violates encapsulation, allowing aliases to the state (and thereof the components) of its container.  Object ownership is one of the well-researched paradigms in the area of alias management. Ownership types support hierarchical object encapsulation rather than the traditional class-level encapsulation. This thesis introduces an extension of Java 6 with support for ownership types as supplementary generic types. That is, Java generics are extended with the ability of carrying ownership information. This extension provides generic ownership support for all of Java; that is, all major language features are addressed so that programs can safely manage and express their aliasing properties. The resulting language is expressive enough to support common programming idioms, with little programming and runtime overhead. We evaluated the programmability of the language by refactoring a major (the most essential) portion of the Java Collections Framework. We also evaluated the performance impact of our refactoring by conducting a small micro-benchmark study to measure the performance time overhead the refactored collections may impose.</p>

2021 ◽  
Author(s):  
◽  
Ahmed Aziz Khalifa

<p>Generic programming has turned out very useful in the development of reusable software. With the Java programming language, genericity is not only meant for reusability, but also for type-safety. Java generics constrain a container object (e.g., list, hash table) to store objects of a pre-specified data type. Nevertheless, safe programming with aliasing (multiple pointers in a program may point to the same object) is still a concern in object-oriented programming language research. A pointing object can mutate the state of the aliased object, reflecting the changes to all of the other pointers (aka aliases) thus affecting their behaviour. As programs grow larger and more complex, such changes in behaviour can be undesirable and difficult to detect and reason about. With respect to container objects, the iterator pattern critically violates encapsulation, allowing aliases to the state (and thereof the components) of its container.  Object ownership is one of the well-researched paradigms in the area of alias management. Ownership types support hierarchical object encapsulation rather than the traditional class-level encapsulation. This thesis introduces an extension of Java 6 with support for ownership types as supplementary generic types. That is, Java generics are extended with the ability of carrying ownership information. This extension provides generic ownership support for all of Java; that is, all major language features are addressed so that programs can safely manage and express their aliasing properties. The resulting language is expressive enough to support common programming idioms, with little programming and runtime overhead. We evaluated the programmability of the language by refactoring a major (the most essential) portion of the Java Collections Framework. We also evaluated the performance impact of our refactoring by conducting a small micro-benchmark study to measure the performance time overhead the refactored collections may impose.</p>


2017 ◽  
Vol 10 (3) ◽  
pp. 48-52
Author(s):  
Nurindah Dwiyani ◽  
Yeka Hendriyani ◽  
Vera Irma Delianti

The purpose of this article is to analyze the needs of developing the worksheet in the Object Oriented Programming (PBO) course. This research is explorative descriptive research. The subjects of this study are students of Electronics Engineering class of 2016 Faculty of Engineering, State University of Padang. Samples were randomly selected by 20 students. Data were collected using observation sheet of PBO lecture and student questionnaire. The result of the observation indicates that the current worksheet is too wide in the scope of the material because of the combination of the PBO 1 and PBO 2 job sheets and the lack of explanation of the statements on the soure code. The results of the questionnaire development needs of the development of the worksheet show that students need a more easily understood job sheet, equipped with success indicators and glossary of terms or functions in the PBO (Java Programming Language). Keywords :  Needs Analysis, Development of Learning Media, Job sheet, PBO


2021 ◽  
Vol 4 ◽  
pp. 64-71
Author(s):  
Volodymyr Boublik

The paper investigates a possibility of developing a non-virtual hierarchy for a special case of class signature, which may possess different interpretations. The approach is similar to double dispatching in the C ++ programming language. As an alternative to polymorphism, a non-polymorphic hierarchy has been suggested based on generic programming templates. This hierarchy is based on inverse parametrization for templates enabling constructing a general scheme for the design pattern. The pattern defined a class architecture suitable for static implementation of double dispatched multimethod for a special case of signature- defined interfaces.In fact, any abstract base class (interface) with purely virtual operations must acquire a polymorphic implementation. Besides, the polymorphism itself, the dependence of a virtual function on two objects – “this” and another parameter – requires the use of double dispatch, turning a class member function into a double dispatched multimethod.A preliminary consideration deals with issues of double dispatching in the C++ programming language. Inheritance with polymorphic class member functions is used. This requires special efforts of adding to both bases and derived classes a couple of virtual functions to support dispatching. In any case, this approach, besides using virtual functions, has a disadvantage of violating one of the SOLID principles, namely the principle of dependency inversion: base classes should not depend on derivatives, which negatively affects the quality of the software.Polymorphism is usually understood as the dynamic tuning of a program to the data type of the object that the program will encounter during its execution. That is, by its nature, polymorphism is a purely dynamic characteristic. However, in C++ literature and in practice, you can come across the term “static polymorphism”.At the same time, research of possibilities of generalized programming (templates) allows transferring some dynamic problems to the static level. In particular, a variant of static polymorphism application without virtual functions can be considered.A variant of non-virtual double scheduling has been proposed, generalized in the form of a created design pattern “Signature multimethod”. The use of the newly created pattern is illustrated with an example of implementing classes of complex numbers. The absence of violations of SOLID principles is shown, and the possibility of supplementing the hierarchy with new derived classes without the need to interfere with the structure of the base class is demonstrated.The approach suggested in this work has been used in courses in object-oriented programming at the Faculty of Informatics of Kyiv-Mohyla Academy.


2018 ◽  
Vol 8 (3) ◽  
pp. 132-135
Author(s):  
Egemen Tekkanat ◽  
Murat Topaloglu

Planning is a very important stage for developing software. A number of systems have been developed for the planning stage, which is a must for software development. Object-oriented programming plays the most important part technically in those systems. Using object-based programming effectively minimises the time and money spent in terms of software development processes. One of the best ways for this is to use design patterns that are also known as modules or program segments consisting of more than one classes and supporting code reuse in order to solve the problems recurring during the development of the software. The aim of this study is to develop a design patterns modeller to be used in Java programming language to make the software development a planned, secure and upgradable process while shortening the time spent and reducing the costs via good planning. Keywords: Java, object-oriented, design patterns, modelling.


2018 ◽  
Vol 2018 ◽  
pp. 1-12
Author(s):  
Wenqi Chen ◽  
Hui Tian ◽  
Chin-Chen Chang ◽  
Fulin Nan ◽  
Jing Lu

Cloud storage, one of the core services of cloud computing, provides an effective way to solve the problems of storage and management caused by high-speed data growth. Thus, a growing number of organizations and individuals tend to store their data in the cloud. However, due to the separation of data ownership and management, it is difficult for users to check the integrity of data in the traditional way. Therefore, many researchers focus on developing several protocols, which can remotely check the integrity of data in the cloud. In this paper, we propose a novel public auditing protocol based on the adjacency-hash table, where dynamic auditing and data updating are more efficient than those of the state of the arts. Moreover, with such an authentication structure, computation and communication costs can be reduced effectively. The security analysis and performance evaluation based on comprehensive experiments demonstrate that our protocol can achieve all the desired properties and outperform the state-of-the-art ones in computing overheads for updating and verification.


2014 ◽  
Vol 11 (1) ◽  
pp. 47-68 ◽  
Author(s):  
Patricia Conde ◽  
Francisco Ortin

Java 7 has included the new invokedynamic opcode in the Java virtual machine. This new instruction allows the user to define method linkage at runtime. Once the link is established, the virtual machine performs its common optimizations, providing better runtime performance than reflection. However, this feature has not been offered at the abstraction level of the Java programming language. Since the functionality of the new opcode is not provided as a library, the existing languages in the Java platform can only use it at the assembly level. For this reason, we have developed the JINDY library that offers invokedynamic to any programming language in the Java platform. JINDY supports three modes of use, establishing a trade-off between runtime performance and flexibility. A runtime performance and memory consumption evaluation is presented. We analyze the efficiency of JINDY compared to reflection, the MethodHandle class in Java 7 and the Dynalink library. The memory and performance costs compared to the invokedynamic opcode are also measured.


Sign in / Sign up

Export Citation Format

Share Document