Implementation of Programming Languages 17 October 2015 | Software Technology Group | 1 Topics on EScala Vaidas Gasiunas, Lucas Satabin.

Slides:



Advertisements
Similar presentations
OO Programming in Java Objectives for today: Overriding the toString() method Polymorphism & Dynamic Binding Interfaces Packages and Class Path.
Advertisements

Object-Oriented Programming Python. OO Paradigm - Review Three Characteristics of OO Languages –Inheritance It isn’t necessary to build every class from.
Component Oriented Programming 1 Chapter 2 Theory of Components.
 Recent researches show that predicative programming can be used to specify OO concepts including classes, objects, interfaces, methods, single and multiple.
AbstractClassesInterfacesPolymorphism1 Abstract Classes, Interfaces, Polymorphism Barb Ericson Georgia Tech April 2010.
Classes and Object- Oriented... tMyn1 Classes and Object-Oriented Programming The essence of object-oriented programming is that you write programs in.
Object-Oriented Analysis and Design
Introduction To System Analysis and Design
Object-Oriented Design & Programming Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Object-Oriented PHP (1)
Object-Oriented Databases v OO systems associated with – graphical user interface (GUI) – powerful modeling techniques – advanced data management capabilities.
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Software Testing and Quality Assurance
OOP in Java Nelson Padua-Perez Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
16/22/2015 2:54 PM6/22/2015 2:54 PM6/22/2015 2:54 PMObject-Oriented Development Concept originated with simulating objects and their interactions. Adapted.
Programming in Scala Chapter 1. Scala: both object-oriented and functional Scala blends –object-oriented and –functional programming in a –statically.
1 ES 314 Advanced Programming Lec 2 Sept 3 Goals: Complete the discussion of problem Review of C++ Object-oriented design Arrays and pointers.
OOP in Java Fawzi Emad Chau-Wen Tseng Department of Computer Science University of Maryland, College Park.
Object-oriented design CS 345 September 20,2002. Unavoidable Complexity Many software systems are very complex: –Many developers –Ongoing lifespan –Large.
© 2008 IBM Corporation Behavioral Models for Software Development Andrei Kirshin, Dolev Dotan, Alan Hartman January 2008.
1 An introduction to design patterns Based on material produced by John Vlissides and Douglas C. Schmidt.
Domain Modeling (with Objects). Motivation Programming classes teach – What an object is – How to create objects What is missing – Finding/determining.
Advanced Database CS-426 Week 2 – Logic Query Languages, Object Model.
Introduction To System Analysis and design
Reactive Programming
Programming Languages and Paradigms Object-Oriented Programming.
CSE 331 Software Design & Implementation Hal Perkins Autumn 2012 Java Classes, Interfaces, and Types 1.
10-Sep-15 Classes. Classes and objects Scala is an Object-Oriented (O-O), functional language Object-Oriented (O-O) means it’s built around “objects”
Chapter 7 – Design and Implementation Lecture 2 1Chapter 7 Design and implementation.
Introductory Software Engineering with a Focus on Dependency Management Christine Hofmeister.
Programming Paradigms Procedural Functional Logic Object-Oriented.
CS 360 Lecture 6.  A model is a simplification of reality  We build models to better understand the system being developed.  We build models of complex.
Copyright 2002 Prentice-Hall, Inc. Modern Systems Analysis and Design Third Edition Jeffrey A. Hoffer Joey F. George Joseph S. Valacich Chapter 20 Object-Oriented.
Introduction To System Analysis and Design
CSC 211 Introduction to Design Patterns. Intro to the course Syllabus About the textbook – Read the introduction and Chapter 1 Good attendance is the.
CSE 425: Object-Oriented Programming I Object-Oriented Programming A design method as well as a programming paradigm –For example, CRC cards, noun-verb.
- Neeraj Chandra.  It’s language written by by Martin Odersky at EPFL  It’s language written by by Martin Odersky at EPFL (École Polytechnique Fédérale.
1 Chapter 8 – Classes and Object: A Deeper Look Outline 1 Introduction 2 Implementing a Time Abstract Data Type with a Class 3 Class Scope 4 Controlling.
1 Class Diagrams: Advanced Concepts. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are the most commonly used diagrams.
TAL7011 – Lecture 4 UML for Architecture Modeling.
UML as a Specification Language for Embedded Systems. By, Mir Ahmed Ali, Asst. Professor, ECM department, SNIST. By, Prof. Narsiah sir, Director of School.
Introducing Allors Applications, Tools & Platform.
Software Engineering Laboratory, Department of Computer Science, Graduate School of Information Science and Technology, Osaka University July 21, 2008WODA.
1 Class Diagrams. 2 Overview Class diagrams are the most commonly used diagrams in UML. Class diagrams are for visualizing, specifying and documenting.
CS162 Week 1 Kyle Dewey. Overview Basic Introduction CS Accounts Scala survival guide.
(1) ICS 313: Programming Language Theory Chapter 12: Object Oriented Programming.
Object Oriented Programming
Lecture 9-1 : Intro. to UML (Unified Modeling Language)
OOP (Object Oriented Programming) Lecture 1. Why a new paradigm is needed? Complexity Five attributes of complex systems –Frequently, complexity takes.
OOP Review CS 124.
Chapter 5 System Modeling. What is System modeling? System modeling is the process of developing abstract models of a system, with each model presenting.
Inheritance and Subclasses CS 21a. 6/28/2004 Copyright 2004, by the authors of these slides, and Ateneo de Manila University. All rights reserved L16:
Inheritance and Class Hierarchies Chapter 3. Chapter 3: Inheritance and Class Hierarchies2 Chapter Objectives To understand inheritance and how it facilitates.
Java Programming, Second Edition Chapter Twelve Advanced Inheritance Concepts.
Inheritance and Class Hierarchies Chapter 3. Chapter Objectives  To understand inheritance and how it facilitates code reuse  To understand how Java.
CSE 341 Section 10 Subtyping, Review, and The Future.
COP 4331 – OOD&P Lecture 7 Object Concepts. What is an Object Programming language definition: An instance of a class Design perspective is different.
ECE 750 Topic 8 Meta-programming languages, systems, and applications Automatic Program Specialization for J ava – U. P. Schultz, J. L. Lawall, C. Consel.
Notices Assn 2 is due tomorrow, 7pm. Moodle quiz next week – written in the lab as before. Everything up to and including today’s lecture: Big Topics are.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Modern Programming Tools And Techniques-I
Microsoft .NET 3. Language Innovations Pan Wuming 2017.
Types of Programming Languages
To Get Started Paper sheet
.NET and .NET Core 5.2 Type Operations Pan Wuming 2016.
Behavioral Models for Software Development
Names, Binding, and Scope
Class Diagrams.
Lecture 1 Introduction to Software Construction
Presentation transcript:

Implementation of Programming Languages 17 October 2015 | Software Technology Group | 1 Topics on EScala Vaidas Gasiunas, Lucas Satabin

Importance of Events  Events – key element of reactive and interactive software  Graphical user interface  Embedded software  Complex event processing  …  Important for software design  Implicit invocation/Inversion of control - ”don't call us, we'll call you”  Essential for reducing coupling in software  Natural abstraction in OO  Attributes – access state  Operations – modify state  Events – observe state changes 17 October 2015 | Software Technology Group | 2

Goals of EScala  Support events as attributes of objects  Describe changes of object’s state  Part of the interface of an object  Objects react to events of other objects  Support different kinds of events  Explicitly triggered (imperative)  Intercepted events (joinpoints ala AOP)  Declarative events – as expressions over other events 3

Imperative Events class TemperatureSensor { imperative evt tempChanged[Int]... def run() { var currentTemp = measureTemp() while (true) { val newTemp = measureTemp() if (newTemp != currentTemp) { tempChanged(newTemp) currentTemp = newTemp } sleep(100) }... } Imperative events can be used for events that are not available as joinpoints or need to collect local state

Declarative and Implicit Events abstract class Figure { evt geomChanged[Unit] = afterExec(moveBy) || afterExec(resize) evt changed[Unit] = geomChanged || afterExec(setColor) evt invalidated[Rectangle] = changed.map(_ => getBounds())... def moveBy(dx: Int, dy: Int) { position.move(dx, dy) } def resize(size: Size) { this.size = size } def setColor(col: Color) { color = col } def getBounds(): Rectangle... }

Using Events class Drawing(val figures: List[Figure]) { evt invalidated = figures.any(_.invalidated)... } class DrawingView(val drawing : Drawing) { drawing.invalidated += redraw def invalidate(area : Rectangle) {... }... } At the end the events lead to reactions Events can be used to define higher level events

Topic #1: Convenient Event Expression Language  Problem: encoding event expressions by closures and higher order functions is not always concise and intuitive.  Solution: a dedicated event expression language with explicit event parameters, local variables and their explicit binding April 14, 2010 | Software Technology Group | 7 abstract class Figure { evt changed = geomChanged(_) || colorChanged(_) evt invalidated(r: Rectangle) = changed && (r = getBounds) evt colorChanged(c: Int) = beforeExec(setColor(c)) && (c != color)... }

Topic #2 Events as Intervals in Time  Current state:  The current model supports events as points in time  No support for relating multiple events  Goal:  Support events as intervals in time  Define operations allowing to related such event in different ways e2 = before(e1)e3 = after(e1) e1 = between(e2, e3)

Topic #2 Events as Intervals in Time  Considering events as intervals of time we eliminate boundary between events and states 17 October 2015 | Software Technology Group | 9 abstract class Alarm { evt isArmed = between(exec(arm), exec(disarm)) evt isDisarmed = between(exec(disarm), exec(arm)) imperative evt intrusionDetected evt alarm = intrusionDetected && within(isArmed) evt isAlarmed = between(alarm, exec(disarm)) def arm() {... } def disarm() {... } }

Topic #3 Changing Values in Event Definitions  Problem: Each time event source changes, the developer must manually register for the events of the new source. April 14, 2010 | Software Technology Group | 10 abstract class Connector { var from, to : Figure (from.changed || to.changed) += update def setFrom(f : Figure) { if (from != null) from.changed -= update from = f from.changed += update } def update {... } }

Topic #3 Changing Values in Event Definitions  Solution: Automatically update of events depending on changing values (behaviors) April 14, 2010 | Software Technology Group | 11 abstract class Connector { val from, to : Behavior[Figure] (from.changed || to.changed) += update def setFrom(f : Figure) { from = f } def update {... } } Behaviors are already available in Functional Reactive Programming (FRP) library of Scala, but need to be integrated with EScala’s events

Technical Perspective  Scala  A modern language combining ideas from object-oriented and functional programming  Academic and industrial interest steadily increasing  Runs on JVM, integrated in Eclipse and other Java IDE’s  Compiler implemented in Scala itself  EScala  Majority of functionality implemented as a pure Scala library  Scala compiler extended to support interception of events 17 October 2015 | Software Technology Group | 12

What will you gain?  Learn about reactive programming techniques: events, behaviors, reactors, aspects  Learn about compiler technology  Get acquainted with Scala and a variety of novel language features that are slowly finding their way into Java and C#  Get in touch with large-scale software development using advanced language features  Contribute to a new, dynamically evolving language 17 October 2015 | Software Technology Group | 13