New Programming Paradigms

Similar documents
Chapter 5 Object-Oriented Programming

Object-Oriented Design

What are the characteristics of Object Oriented programming language?

General Concepts. Abstraction Computational Paradigms Implementation Application Domains Influence on Success Influences on Design

Selenium Testing Course Content

Concepts of Programming Languages

Concepts of Programming Languages

Programming Languages and Program Development

Programmiersprachen (Programming Languages)

Chapter 1. Preliminaries

Chapter 1 Preliminaries

Programming Languages, Summary CSC419; Odelia Schwartz

OBJECT ORIENTED PROGRAMMING USING C++ CSCI Object Oriented Analysis and Design By Manali Torpe

Idioms for Building Software Frameworks in AspectJ

Multi-Paradigm Approach for Teaching Programming

Index. Index. More information. block statements 66 y 107 Boolean 107 break 55, 68 built-in types 107

Learning Objectives. C++ For Artists 2003 Rick Miller All Rights Reserved xli

Com S 541. Programming Languages I

Lecture 13: Object orientation. Object oriented programming. Introduction. Object oriented programming. OO and ADT:s. Introduction

Paytm Programming Sample paper: 1) A copy constructor is called. a. when an object is returned by value

MaanavaN.Com CS1203 OBJECT ORIENTED PROGRAMMING DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Design issues for objectoriented. languages. Objects-only "pure" language vs mixed. Are subclasses subtypes of the superclass?

Metamodelling & Metaprogramming. Lena Buffoni

Chapter 1. Preliminaries

Preface to the Second Edition Preface to the First Edition Brief Contents Introduction to C++ p. 1 A Review of Structures p.

BCS THE CHARTERED INSTITUTE FOR IT. BCS Higher Education Qualifications BCS Level 6 Professional Graduate Diploma in IT EXAMINERS' REPORT

Object-Oriented Design

Compilation I. Hwansoo Han

DOT NET Syllabus (6 Months)

CHAPTER 9 DESIGN ENGINEERING. Overview


Java SE7 Fundamentals

8/27/17. CS-3304 Introduction. What will you learn? Semester Outline. Websites INTRODUCTION TO PROGRAMMING LANGUAGES

Contents. Figures. Tables. Examples. Foreword. Preface. 1 Basics of Java Programming 1. xix. xxi. xxiii. xxvii. xxix

Question No: 1 ( Marks: 1 ) - Please choose one One difference LISP and PROLOG is. AI Puzzle Game All f the given

Selenium Training. Training Topics

CHAPTER 5 GENERAL OOP CONCEPTS

Topic 9: Type Checking

Topic 9: Type Checking

Chapter 5. Names, Bindings, and Scopes

CS558 Programming Languages Winter 2013 Lecture 8

Programmazione. Prof. Marco Bertini

Data Types. Every program uses data, either explicitly or implicitly to arrive at a result.

Reflective Java and A Reflective Component-Based Transaction Architecture

2.4 Structuring programs

Linguistic Reflection Via Mirrors

Selenium Course Content

Introduction to Information Systems

Course Description. Learn To: : Intro to JAVA SE7 and Programming using JAVA SE7. Course Outline ::

CS252 Advanced Programming Language Principles. Prof. Tom Austin San José State University Fall 2013

CompuScholar, Inc. Alignment to Nevada "Computer Science" Course Standards

Programming Paradigms

Science of Computer Programming. Aspect-oriented model-driven skeleton code generation: A graph-based transformation approach

Object Oriented Programming in Java. Jaanus Pöial, PhD Tallinn, Estonia

Chapter 1. Preview. Reason for Studying OPL. Language Evaluation Criteria. Programming Domains

1. Write two major differences between Object-oriented programming and procedural programming?

The major elements of the object-oriented model

C++ Important Questions with Answers

CS 6456 OBJCET ORIENTED PROGRAMMING IV SEMESTER/EEE

Lecture Contents CS313D: ADVANCED PROGRAMMING LANGUAGE. What is Inheritance?

BCS THE CHARTERED INSTITUTE FOR IT. BCS Higher Education Qualifications BCS Level 6 Professional Graduate Diploma in IT EXAMINERS' REPORT

Topics in Object-Oriented Design Patterns

Top Down Design vs. Modularization

Program Abstractions, Language Paradigms. CS152. Chris Pollett. Aug. 27, 2008.

Introduction to Reflective Java

Short Notes of CS201

CS313D: ADVANCED PROGRAMMING LANGUAGE

Why are there so many programming languages? Why do we have programming languages? What is a language for? What makes a language successful?

CS321 Languages and Compiler Design I. Winter 2012 Lecture 1

The Art of Metaprogramming in Java. Falguni Vyas Dec 08, 2012

Some instance messages and methods

IA010: Principles of Programming Languages

CPS 506 Comparative Programming Languages. Programming Language

Chapter 11 Object and Object- Relational Databases

Certification In Java Language Course Course Content

CS201 - Introduction to Programming Glossary By

Object- Oriented Design with UML and Java Part I: Fundamentals

Programming in Scala Second Edition

Cpt S 122 Data Structures. Course Review Midterm Exam # 2

Lecture Notes on Programming Languages

Programming in C# for Experienced Programmers

Programming in C# (20483)

Advanced Database Applications. Object Oriented Database Management Chapter 13 10/29/2016. Object DBMSs

Object Oriented Programming. Java-Lecture 11 Polymorphism

Object Oriented Programming

An Introduction to Object Orientation

PROGRAMMING LANGUAGE 2

CS313D: ADVANCED PROGRAMMING LANGUAGE

Java SE 7 Programming

Topics Covered Thus Far. CMSC 330: Organization of Programming Languages. Language Features Covered Thus Far. Programming Languages Revisited

ITCS Jing Yang 2010 Fall. Class 16: Object and Object- Relational Databases (ch.11) References

Java J Course Outline

DESIGN PATTERN - INTERVIEW QUESTIONS

CSE373: Data Structure & Algorithms Lecture 23: Programming Languages. Aaron Bauer Winter 2014

R13 SET Discuss how producer-consumer problem and Dining philosopher s problem are solved using concurrency in ADA.

College Board. AP CS A Labs Magpie, Elevens, and Picture Lab. New York: College Entrance Examination Board, 2013.

RAJIV GANDHI COLLEGE OF ENGINEERING AND TECHNOLOGY DEPARTMENT OF INFORMATION TECHNOLOGY OBJECT ORIENTED PROGRAMMING QUESTION BANK UNIT I 2 MARKS

Design Patterns. Manuel Mastrofini. Systems Engineering and Web Services. University of Rome Tor Vergata June 2011

CSCD01 Engineering Large Software Systems. Design Patterns. Joe Bettridge. Winter With thanks to Anya Tafliovich

Object-Oriented Programming

Transcription:

New Programming Paradigms Lecturer: Pánovics János (google the name for further details) Requirements: For signature: classroom work and a 15-minute presentation Exam: written exam (mainly concepts and code analysis)

Programming Languages What is a computer good for? Data processing machine: can process a big amount of data in a short time (almost) without errors. Task is written by a program or (program) code. The code is written in a special language: programming language.

Categories of Computer Languages programming language (e.g., C) database query language (e.g., SQL) scripting language (e.g., Perl) visual language (e.g., LabView) modeling language (e.g., UML) markup language (e.g., XML) style sheet language (e.g., CSS) configuration language (e.g., JSON) domain-specific language (e.g., RecipeBook)

Classification of Programming Languages Machine language: Program in machine language: machine code (binary). Translator program: not required. Assembly languages: Program in assembly: assembly (source) code (text). Translator program: assembler. High-level programming languages: Program in HLPL: (C, Pascal, ) source code (text). Translator program: compiler or interpreter.

Compilers and Interpreters Typical compilation process: source code source code object code preprocessor compiler linker executable code runtime system execution

Compilers and Interpreters Interpretation process: source code execution interpreter

Compilers and Interpreters Hybrid execution process: source code compiler intermediate language code execution interpreter

type system abstraction reusability concurrency Features of High-Level Programming Languages exception handling secure programming (assertions)

Type System untyped languages (e.g., assembly) single-type languages (e.g., scripting and markup languages) typed languages static typing (types determined at compile time) manifestly typed languages (explicit declarations; e.g., Java) type-inferred languages (implicit declarations; e.g., Haskell) dynamic typing (types determined at run time, e.g., Python): more flexible but also more error-prone duck typing ( If it walks like a duck and it quacks like a duck, then it must be a duck. ) weak typing (implicit type conversions; e.g., JavaScript) strong typing (type equivalence; e.g., Pascal): type-safe languages

Abstraction Data abstraction: data type programmer-defined type abstract data type (encapsulation, information hiding) class (inheritance) abstract class interface Procedural abstraction: subprogram (function, procedure), method package, module, unit, inheritance, polymorphism (overriding) overloading namespace (Java: package),.net assembly (Java: jar), generics (templates, parameterized types and methods)

Programming Paradigms A programming paradigm is an approach reflecting a possible way of thinking about a system to be modeled; it is a style of programming. There is no best approach. Which one to use depends on the problem. Aspects to consider: conciseness, readability, flexibility, reusability, efficiency, etc. Paradigms are not meant to be mutually exclusive.

List of Common Paradigms Imperative: control flow is an explicit sequence of statements. Declarative: programs state the result you want, not how to get it. Object-oriented: computation is effected by sending messages to objects; objects have state and behavior. Event-driven: control flow is determined by asynchronous actions (from humans or sensors). Flow-driven: computation is specified by multiple processes communicating over predefined channels. Aspect-oriented: programs have cross-cutting concerns applied transparently. Reflective: programs manipulate their own structures (also called metaprogramming).

Imperative Programming The program is made up of statements, which describe how to solve the problem. Sequential execution is the default; special statements that influence control flow: jumps. Variables are used to store values. Computer-friendly way of thinking: closely related to von Neumann architecture. Does not require intelligent run-time environment. Subparadigms (programming techniques): Structured programming: both data and code have hierarchical structures. Procedural programming: subprograms (functions and procedures) are used to structure code. Uses calls and parameters. Modular programming: groups programming constructs that represent the same concern of the system into distinct, loosely coupled modules.

Declarative Programming Contrasts with imperative programming. The program describes what the problem is, rather than specifying how to solve it. Human-friendly way of thinking. Requires an intelligent run-time environment. Subparadigms: Functional (applicative) programming: computation proceeds by (nested) function calls that avoid any global state. Function-level (combinator) programming: programs have no variables, they use only functions and functionals. Logic (rule-based) programming: programmer specifies a set of facts and rules, and an engine infers the answers to questions.

Object-Oriented Programming The task of a program is carried out by the communication of objects. Objects have a unique identity (OID), a state (current values of their fields), and behavior (describing how they react to messages; realized by methods). Combines data model with procedural model. Class: type (abstraction) of similar objects. Class-based inheritance: subclass defined based on superclass. Class hierarchy: object polymorphism (Liskov substitution principle). Overriding: method polymorphism. Prototype-based inheritance: implements inheritance via cloning of instances.

Aspect-Oriented Programming Based on the separation of concerns (SoC): program elements representing the same concern of the problem should be placed in the same module, an aspect. Typically used for separating code responsible for nonfunctional requirements, like logging, persistence, security, etc. Join point: a moment of execution when the control can be passed over to the code of an aspect. Advice: the action to perform at a given join point. Pointcut: defines a set of join points where the associated advice should be applied. Weaving: assembling the final program from the separated modules. It can be done at compile (preprocessing) time, link time, load time, or run time.

Metaprogramming A technique that allows the programmer to manage (examine, manipulate, or construct) the base program from a higher dimension, the metaprogram. The code in the base level is considered data in the meta level. Reflection: construction of metaobjects representing (reflecting) elements of the base program. Structural reflection: access data structures (such as classes or methods) used by the program statically fixed at compile time. Behavioral reflection: intercept an operation (such as a method invocation) and alter the behavior of that operation. Introspection: the program can examine itself. Intercession: the program can modify its state/meaning. Reification: implementing the effect of manipulation of metaobjects in the base level; i.e., making an abstract concept concrete. Metaobject protocol (MOP): specifies what kind of metainformation can be accessed and how it can be used to analyze or modify the base program.

Programming Languages and Paradigms Pure languages: support only one paradigm (e.g., C). Hybrid languages: support two paradigms (e.g., Java 7). Multiparadigm languages: support more than two paradigms (e.g., C#). Programmers may choose the paradigm that is best suited for the problem and their needs.