Towards Multi-Paradigm Software Development Valentino Vranić [email protected] Department of...

12
Towards Multi-Paradigm Software Development Valentino Vranić [email protected] Department of Computer Science and Engineering Faculty of Electrical Engineering and Information Technology Slovak University of Technology in Bratislava

Transcript of Towards Multi-Paradigm Software Development Valentino Vranić [email protected] Department of...

Page 1: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

Towards Multi-Paradigm Software Development

Valentino Vranić

[email protected]

Department of Computer Science and Engineering

Faculty of Electrical Engineering and Information Technology

Slovak University of Technology in Bratislava

Page 2: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

2

Overview

• Several new approaches to software development have a multi-paradigm character

• Some are explicit with this (e.g. multi-paradigm design for C++)

• And some are implicit (e.g. aspect-oriented programming)

The main points of this presentation:Use of the term paradigm regarding software

developmentMulti-paradigm approaches to software

development

Page 3: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

3

The Meaning of Paradigm

• Introduced in science by Thomas Kuhn:– a consistent collection of methods and techniques

accepted by the relevant scientific community as a prevailing methodology of the specific field

• Widely used (and abused) in computer science• Used at two levels:

– large-scale paradigms– small-scale paradigms

• Multi-paradigm– the application of multiple paradigms

• Metaparadigm– a paradigm of paradigms: shows how to select and

combine paradigms

Page 4: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

4

Large-Scale Paradigms

• The essence of the software development process

• Refer to all the phases of the software development

• A change of paradigm: evolution or revolution• A change of a paradigm in science is taking

part through the scientific revolution• A paradigm is dominant in its field, i.e. there

can be only one

Page 5: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

5

Large-Scale Paradigms (contd.)

• But there are several software development paradigms currently existing (imperative, procedural, object-oriented, functional, logic…)

• Some paradigms seem to evolve:

Imperative programming

Procedural programming

Object-oriented programming

Page 6: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

6

Small-Scale Paradigms

• The other use of the term paradigm: to denote programming language mechanisms

• Scope, commonality and variability (SCV) analysis• Example: procedures

– S: a collection of similar code fragments– C: the code common to all fragments in S– V: the “uncommon” code in S; variabilities handled by

the procedure parameters and/or the code before or after the procedure call

• Some other small-scale paradigms: templates, objects, inheritance…

• Large-scale paradigms consist of the small-scale paradigms

Page 7: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

7

Aspect-Oriented Programming

• Aims at modularization of the crosscutting concerns (resulting in the tangled code)

• Main AOP approaches (next slide) build upon the OOP

• AOP is not OOP bound — it is also applicable to procedural or functional programming

• Another paradigm is needed to which AOP is to be applied

Page 8: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

8

Generative Programming

Composition Filters

Demeter/Adaptive Programming

Subject-Oriented Programming

Generic Programming

Domain-Specific Languages

Aspect-Oriented Programming

Generative Programming

• Aims at automatic software manufacture

• Has to be tailored to a particular domain yielding a paradigm GP is a metaparadigm

Xerox PARC Aspect-Oriented Programming

Object-Oriented Programming

Page 9: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

9

Multi-Paradigm Programming in Leda

• Leda was created as a multi-paradigm language — in terms of the large-scale paradigms

• Enables combination of the procedural, object-oriented, functional and logic programming

• Problems:– extension to other paradigms– no support in selecting and combining paradigms

Page 10: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

10

Multi-Paradigm Design for C++

• Intended for C++, but can be tailored to any richly expressive language

• Makes an explicit use of the small-scale paradigm concept

• Two analyses, commonality and variability, performed both on application and solution domain

• Lining up yields which paradigm is to be used for which feature

Page 11: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

11

Intentional Programming

• Programming abstractions are limited by the fixed syntax programming languages

• IP: a program represented by the AST (called intentional tree)

• Requires special programming environment• Binary format for the program files• MPD would contribute to more regularized use

of the IP• IP enables creation of the new intentions —

small-scale paradigms

Page 12: Towards Multi-Paradigm Software Development Valentino Vranić vranic@elf.stuba.sk Department of Computer Science and Engineering Faculty of Electrical Engineering.

12

Conclusions

• The need to distinguish between large- and small-scale paradigms

• Multi-paradigm software development is a growing concept

• Widely present at implementation level• Has to be “legalized” at design level• MPD — a possible basis for future multi-

paradigm software development• MPD requires further improvement:– extended notation

– method incorporating traditional approaches into MPD

– the connection with design patterns