166 research outputs found
Refactoring Composite to Visitor and Inverse Transformation in Java
We describe how to use refactoring tools to transform a Java program
conforming to the Composite design pattern into a program conforming to the
Visitor design pattern with the same external behavior. We also describe the
inverse transformation. We use the refactoring tool provided by IntelliJ IDEA
Invertible Program Restructurings for Continuing Modular Maintenance
When one chooses a main axis of structural decompostion for a software, such
as function- or data-oriented decompositions, the other axes become secondary,
which can be harmful when one of these secondary axes becomes of main
importance. This is called the tyranny of the dominant decomposition. In the
context of modular extension, this problem is known as the Expression Problem
and has found many solutions, but few solutions have been proposed in a larger
context of modular maintenance. We solve the tyranny of the dominant
decomposition in maintenance with invertible program transformations. We
illustrate this on the typical Expression Problem example. We also report our
experiments with Java and Haskell programs and discuss the open problems with
our approach.Comment: 6 pages, Early Research Achievements Track; 16th European Conference
on Software Maintenance and Reengineering (CSMR 2012), Szeged : Hungary
(2012
Practical use of static composition of refactoring operations
6 pagesInternational audienceRefactoring tools are commonly used for remodularization tasks. Basic refactoring operations are combined to perform complex program transformations, but the resulting composed operations are rarely reused, even partially, because popular tools have few support for composition. In this paper, we recast two calculus for static composition of refactorings in a type system framework and we discuss their use for inferring useful properties. We illustrate the value of support for static composition in refactoring tools with a complex remodularization use case: a round-trip transformation between programs conforming to the Composite and Visitor patterns
Recommended from our members
Reflective and relativistic refactoring with feature-awareness
Refactoring is a core technology in modern software development. It is central to popular software design movements, such as Extreme Programming [23] and Agile software development [91], and all major Integrated Development Environments (IDEs) today offer some form of refactoring support. Despite this, refactoring engines have languished behind research. Modern IDEs offer no means to sequence refactorings to automate program changes. Further, current refactoring engines exhibit problems of speed and expressivity, which makes writing composite refactorings such as design patterns infeasible. Even worse, existing refactoring tools for Object-Oriented languages are unaware of configurations in Software Product Lines (SPLs) codebases. With this motivation in mind, this dissertation makes three contributions to address these issues: First, we present the Java API library, called R2, to script Eclipse refactorings to retrofit design patterns into existing programs. We encoded 18 out of 23 design patterns described by Gang-of-Four [57] as R2 scripts and explain why the remaining refactorings are inappropriate for refactoring engines. R2 sheds light on why refactoring speed and expressiveness are critical issues for scripting. Second, we present a new Java refactoring engine, called R3, that addresses an Achilles heel in contemporary refactoring technology, namely scripting performance. Unlike classical refactoring techniques that modify Abstract Syntax Trees (ASTs), R3 refactors programs by rendering ASTs via pretty printing. AST rendering never changes the AST; it only displays different views of the AST/program. Coupled with new ways to evaluate refactoring preconditions, R3 increases refactoring speed by an order of magnitude over Eclipse and facilitates computing views of a program where the original behavior is preserved. Third, we provide a feature-aware refactoring tool, called X15, for SPL codebases written in Java. X15 takes advantage of R3's view rendering to implement a projection technology in Feature-Oriented Software Development, which produces subprograms of the original SPL by hiding unneeded feature code. X15 is the first feature-aware refactoring tool for Java that implements a theory of refactoring feature modules, and allows users to edit and refactor SPL programs via âviewsâ. In the most demanding experiments, X15 barely runs a second slower than R3, giving evidence that refactoring engines for SPL codebases can indeed be efficient.Computer Science
An Automatic Reversible Transformation from Composite to Visitor in Java
National audienceWe build reversible transformations between Composite and Visitor design patterns in Java programs. Such transformations represent an automatic reversible switching between different program architectures with a guarantee of semantic preservation. In this paper, we detail the algorithms of the transformations implemented by composing elementary refactoring operations. The transformations were automated with the refactoring tool of a popular IDE: Intellij Idea
Views, Program Transformations, and the Evolutivity Problem in a Functional Language
We report on an experience to support multiple views of programs to solve the
tyranny of the dominant decomposition in a functional setting. We consider two
possible architectures in Haskell for the classical example of the expression
problem. We show how the Haskell Refactorer can be used to transform one view
into the other, and the other way back. That transformation is automated and we
discuss how the Haskell Refactorer has been adapted to be able to support this
automated transformation. Finally, we compare our implementation of views with
some of the literature.Comment: 19 page
Program Transformation based Views for Modular Maintenance
PosterNational audienceModular programming is a practical solution for separation of concerns but the support for modularity provided by programming languages does not resolve the classic expression problem and more generally the tyranny of the dominant decomposition: evolutions are modular only on the principal axis of decomposition. To solve this problem, a practical solution would be to be able to choose the architecture of an application each time one has to make it evolve. We provide a prototype tool for the Haskell language to support that. Our tool allows to build transformations to switch Haskell programs from one structure to another. We do this by driving a refactoring tool for Haskell (HaRe): transformations are built by chaining elementary operations of refactoring. Since each elementary refactoring operation preserve the semantics, the whole transformations also do
MORE: A multiâobjective refactoring recommendation approach to introducing design patterns and fixing code smells
Peer Reviewedhttps://deepblue.lib.umich.edu/bitstream/2027.42/137556/1/smr1843.pdfhttps://deepblue.lib.umich.edu/bitstream/2027.42/137556/2/smr1843_am.pd
Vues et transformations de programmes pour la modularité des évolutions
La maintenance consomme une grande partie du coût de développement des logiciels ce qui rend l optimisation de ce coût parmi les enjeux importants dans le monde du génie logiciel. Dans cette thÚse nous visons à optimiser ce coût par rendre ces maintenances modulaires. Pour atteindre cet objectif, nous définissons des transformations des architectures des programmes qui permettent de transformer le programme à maintenir vers une architecture qui facilite la tùche de maintenance voulue. Nous nous concentrons plus sur la transformation entre les architectures à propriétés de modularité duales tels que les patrons de conception Composite et Visiteur. Dans ce contexte, nous définissons une transformation automatique et réversible basée sur le refactoring entre un programme structuré selon le Composite et sa structureVisiteur correspondante. Cette transformation est validée par la génération d une précondition qui garantit statiquement sa réussite. Elle est aussi adaptée afin qu elle prenne en compte la transformation de quatre variations du patron Composite et est validée sur le programme JHotDraw qui comporte ces quatre variations. Nous définissons aussi une transformation réversible au sein du patron Singleton afin de pouvoir bénéficier de l optimisation par l introduction de ce patron et la souplesse par sa suppression selon les exigences de l utilisateur du logiciel.Maintenance consumes a large part of the cost of software development which makes the optimization of that cost among the important issues in the world of software engineering. In this thesis we aim to optimize this cost by making these maintenances modular. To achieve this goal, we define transformations of program architectures that allow to transform a program to maintain into an architecture that facilitates the maintenance tasks required. We focus on transformation between architectures having dual modularity properties such as Composite and Visitor designpatterns. In this context, we define an automatic and reversible transformation based on refactoring between a program structured according to the Composite structure and its corresponding Visitor structure. This transformation is validated by generating a precondition which guarantees statically its success. It is also adapted to take into account the transformation of four variations of Composite pattern and it is then applied to JHotDraw program in which these four variations occur. We define also a reversible transformation in the Singleton pattern to benefit from optimization by introducing this pattern and flexibility by its suppression according to the requirements of the software user.NANTES-ENS Mines (441092314) / SudocSudocFranceF
1 Sharing Bad Practices in Design to Improve the Use of Patterns
To ensure the use of good analysis and design practices and an easier maintenance of software, analysts and designers may use patterns. To help them, we propose models inspection in order to detect instantiations of âspoiled pattern â and models reworking through the use of the design patterns. As a design pattern allows the instantiation of the best known solution for a given problem, a âspoiled pattern â allows the instantiation of alternative solutions for the same problem: requirements are respected, but architecture is improvable. We have collected a set of alternative solutions and deduced the corresponding spoiled patterns. We have defined a first catalog of these improvable practices from several experiments with students. To overcome the limits imposed by this method (restricted public, limited problems and tiresome validation process), we would like to open this problematic to the expert community. Therefore, we propose a collaborative website sharing bad practices in object oriented design to improve the use of patterns
- âŠ