Unix Tools As Visual Programming Components in a GUI-Builder
Total Page:16
File Type:pdf, Size:1020Kb
Unix Tools as Visual Programming Components Ý in a GUI-builder Environment £ Diomidis Spinellis Department of Management Science and Technology Athens University of Economics and Business Patision 76, GR-104 34 Athens, Greece email: [email protected] September, 2001 Abstract Introduction A number of environments support the visual composition Development environments based on ActiveX controls and of graphical user interfaces (GUIs) using components with a JavaBeans are marketed as “visual programming” plat- predefined set of interfaces. In addition, technologies such forms; in practice their visual dimension is limited to the as ActiveX and JavaBeans allow the development of visual design and implementation of an application’s graphical components (typically GUI elements) that can be seamlessly user interface (GUI. The availability of sophisticated GUI incorporated into an integrated development environment development environments and visual component develop- (IDE) and subsequently used in application development. In ment frameworks is now providing viable platforms for this article we present how visual IDEs and components can implementing visual programming within general-purpose be extended beyond GUI development to support visual pro- platforms, i.e. for the specification of non-GUI program gramming for a particular domain. functionality using visual representations. We describe A visual programming language can be informally de- how specially-designed reflective components can be used in an industry-standard visual programming environment fined as a programming language with a syntax that in- cludes visual expressions such as diagrams, free-hand to graphically specify sophisticated data transformation sketches, icons, or graphical manipulations [1]. Visual pipelines that interact with GUI elements. The components are based on Unix-style filters repackaged as ActiveX con- programming approaches aim towards easing the program- ming learning curve or enhancing programming productiv- trols. Their visual layout on the development environment canvas is used to specify the connection topology of the ity. Their adoption was based on a number of premises [2]: resultant pipeline. The process of converting filter-style ¯ pictures may be able to concisely convey meaning programs as visual controls is automated using a domain- more efficiently than words, specific language. We demonstrate the approach through the design and the visual implementation of a GUI-based ¯ pictures could help understanding and remembering, spelling checker. ¯ pictures may enhance the experience of programming by making it more interesting, and Keywords ¯ culturally-neutral pictures can be understandable re- gardless of what language people speak. Visual programming, components, reflection, Unix tools, However, empirical studies did not find visual programming pipe and filter architecture, reuse. inherently superior to text-based programs; the extent to which a given notation is suitable for expressing a partic- £ Software—Practice and Experiece, 32(1):57–71, 2002. ular task depends on the context in which the language is Ý This is a machine-readable rendering of a working paper draft that led employed [3, 4, 5]. Early work on visual programming, to a publication. The publication should always be cited in preference to this draft using the reference in the previous footnote. This material is although promising when applied to “toy” problems, ran presented to ensure timely dissemination of scholarly and technical work. into difficulties when the methods were tried on problems Copyright and all rights therein are retained by authors or by other copy- of realistic size. Two approaches for alleviating this prob- right holders. All persons copying this information are expected to adhere lem were followed: a number of researchers applied visual to the terms and constraints invoked by each author’s copyright. In most cases, these works may not be reposted without the explicit permission of programming languages to limited or domain-specific parts the copyright holder. of software development such as GUI programming, the 1 graphic depiction of data structure behaviour, or the combi- ponents and their execution environment; Section presents nation of textually programmed units to build new programs how the controls we have implemented support visual pro- [1]. Others, proposed the design of visual programming gramming; in Section we analyse the design and implemen- languages based on formalisms used by existing, standard, tation of the visual controls, in Section we present how the component-based visual engineering languages such as the control creation process can be automated, in Section we ITU-T MSC standard for message sequence charts, or the describe an exemplar application utilising visual program- IEC-1131 standard for function block languages [6]. ming controls, and in Section we evaluate the approach we In our approach we capitalise on the strength of exist- propose. Section concludes the paper with directions for ing GUI-builder IDEs by crafting industry-standard soft- further work. ware components that can be used within the GUI-designer The elements of our approach: visual programming, of the IDE to perform data-flow-oriented visual program- component-based development, a graphical front-end to ming. Although we demonstrate our method in the context Unix tools, data-flow visual languages, and pipe and filter of a specific domain (the visual composition of data-flow architectures have been extensively studied. See for exam- pipelines), the same underlying principles can be applied to ple the references [2, 14, 1, 15, 6] (discussing visual pro- different visual programming domains. gramming and providing examples of specific approaches), We define a software component as a unit of composition [16, 17, 18, 3] (discussing graphical Unix-tool front ends), with contractually specified interfaces and explicit context [19, 20, 21, 7, 22] (discussing component-based develop- dependencies only; one that can be deployed independently ment), [17, 23, 24, 25, 26, 27] (discussing visual data-flow and is subject to third-party composition [7]. Components, approaches), and [28, 29] (discussing pipe and filter archi- in common with objects, encapsulate state, allow access tectures). The main contributions of this paper are: the pro- to it through separately described interfaces, and support posal to use standard GUI builders as visual programming modular design based on separation of concerns. However, environments by means of specially crafted reflective com- components differ from objects in a number of ways: they ponents, the idea that GUI builders can be used to configure can be implemented in different languages, they are often sophisticated component interactions and deployment sce- packaged in binary containers, they can encapsulate multi- narios, and the demonstration of visual programming and ple objects, and are typically more robustly packaged than GUI interfacing utilising the well-known Unix text process- objects [8]. Components that support visual composition ing tools encapsulated as ActiveX components. implement a set of interfaces defined by the visual pro- gramming environment that supports their use. These inter- faces allow the visual placement of components on forms, Component Source and Execution En- the handling of user-input events, and the persistent spec- ification of their properties at program design time. Two vironment widespread families of visual components are JavaBeans [9] and ActiveX controls [10]. Most existing visual components (also known as controls Visual components are supported by a number of IDEs. or widgets) provide GUI interface elements. Typical exam- Typical examples are Visual Basic (VB), Delphi, JBuilder, ples include text-input boxes, buttons, list boxes, grids, ra- Latte, and Visual Caf´e. Although ActiveX controls, Jav- dio buttons, graphs, and file selection dialogs. The few vi- aBeans, and their respective environments are marketed as sual components that do provide computationally interest- “visual programming” technologies, in practice, their vi- ing processing (such as Microsoft’s Internet Transfer con- sual dimension is limited to the design and implementa- trol used to perform HTTP/FTP data transfers) do not utilise tion of graphical user interfaces (GUIs). A number of sys- their visual dimension; they are presumably packaged as tems such as Khoros/Cantata [11, 12] and LabVIEW [13] visual components in order to expose their properties for support component-based visual programming — also re- editing using the standard IDE property editing mecha- ferred to as coarse-grained visual programming — using nisms. Our candidates for repackaging as visual compo- specialised components and a corresponding dedicated de- nents had to provide non-trivial computational functional- velopment environment. Now, the availability of sophisti- ity, be amenable to visual manipulation, and be available for cated GUI-builder IDEs and the respective component de- reuse. We decided to base our work on the numerous user velopment frameworks provides us with an alternative ap- and system programs available under the Unix operating proach for implementing coarse-grained visual program- system implementations. Based on the Unix tool-centred ming: one based on widely deployed, industry-standard philosophy, software developers have created a large collec- platforms. tion of programs that provide a single service (e.g. compare In the following sections we present how specially-