TOP Rinus Plasmeijer – Bas Lijnse - Peter Achten Pieter Koopman - Steffen Michels - Jurrien Slutterheim (TNO-RU) Jan Martin Jansen (NLDA) - Laszlo Domoszlai.

Slides:



Advertisements
Similar presentations
1 From Grids to Service-Oriented Knowledge Utilities research challenges Thierry Priol.
Advertisements

Programming Paradigms and languages
STATEMATE A Working Environment for the Development of Complex Reactive Systems.
Task Oriented Programming in using Rinus Plasmeijer – Bas Lijnse - Peter Achten Pieter Koopman - Steffen Michels - Jurriën Stutterheim Jan Martin Jansen.
The State of the Art in Distributed Query Processing by Donald Kossmann Presented by Chris Gianfrancesco.
By Philippe Kruchten Rational Software
Introduction to Operating Systems CS-2301 B-term Introduction to Operating Systems CS-2301, System Programming for Non-majors (Slides include materials.
FP-dag Pimp my workflow system A tool preview of iTasks 2.0 Bas Lijnse.
Review Amit Shabtay. March 3rd, 2004 Object Oriented Design Course 2 Review What have we done during the course? Where to learn more? What is for the.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Lecture 23: Software Architectures
Rinus Plasmeijer – Jan Martin Jansen - Peter Achten – Pieter Koopman University of Nijmegen - Dutch Defense Academy clean.cs.ru.nlhttp://
Scripting Languages For Virtual Worlds. Outline Necessary Features Classes, Prototypes, and Mixins Static vs. Dynamic Typing Concurrency Versioning Distribution.
Course Instructor: Aisha Azeem
C++ fundamentals.
Slide 1-1 Copyright © 2004 Pearson Education, Inc. Operating Systems: A Modern Perspective, Chapter 1.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
Architectural Design.
February Semantion Privately owned, founded in 2000 First commercial implementation of OASIS ebXML Registry and Repository.
INTRODUCTION TO WEB DATABASE PROGRAMMING
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
Task Oriented Programming in using Rinus Plasmeijer – Bas Lijnse - Peter Achten Pieter Koopman - Steffen Michels – Jurriën Stutterheim Jan Martin Jansen.
Task Oriented Programming in using Rinus Plasmeijer – Bas Lijnse - Peter Achten Pieter Koopman - Steffen Michels - Jurriën Stutterheim Jan Martin Jansen.
NOTE: To change the image on this slide, select the picture and delete it. Then click the Pictures icon in the placeholder to insert your own image. WEB.
Meir Botner David Ben-David. Project Goal Build a messenger that allows a customer to communicate with a service provider for a fee.
1 CMPT 275 High Level Design Phase Architecture. Janice Regan, Objectives of Design  The design phase takes the results of the requirements analysis.
An Introduction to Software Architecture
Architectural Design portions ©Ian Sommerville 1995 Establishing the overall structure of a software system.
M1G Introduction to Database Development 6. Building Applications.
4/2/03I-1 © 2001 T. Horton CS 494 Object-Oriented Analysis & Design Software Architecture and Design Readings: Ambler, Chap. 7 (Sections to start.
©Ian Sommerville 2000 Software Engineering, 6th edition. Chapter 10Slide 1 Architectural Design l Establishing the overall structure of a software system.
CSC-682 Cryptography & Computer Security Sound and Precise Analysis of Web Applications for Injection Vulnerabilities Pompi Rotaru Based on an article.
RELATIONAL FAULT TOLERANT INTERFACE TO HETEROGENEOUS DISTRIBUTED DATABASES Prof. Osama Abulnaja Afraa Khalifah
Ajax and Client-Side Evaluation of i-Tasks Workflow Specifications Rinus Plasmeijer – Jan Martin Jansen - Peter Achten – Pieter Koopman University of Nijmegen.
Task Oriented Programming in using Rinus Plasmeijer – Bas Lijnse - Peter Achten Pieter Koopman - Steffen Michels - Jurriën Stutterheim Jan Martin Jansen.
Chapter 18 Object Database Management Systems. McGraw-Hill/Irwin © 2004 The McGraw-Hill Companies, Inc. All rights reserved. Outline Motivation for object.
An Ontological Framework for Web Service Processes By Claus Pahl and Ronan Barrett.
Chapter 10 Analysis and Design Discipline. 2 Purpose The purpose is to translate the requirements into a specification that describes how to implement.
Prepared by: Elsy Torres Shajida Berry Siobhan Westby.
Chapter 2: A Brief History Object- Oriented Programming Presentation slides for Object-Oriented Programming by Yahya Garout KFUPM Information & Computer.
CPSC 372 John D. McGregor Module 3 Session 1 Architecture.
RUBRIC IP1 Ruben Botero Web Design III. The different approaches to accessing data in a database through client-side scripting languages. – On the client.
CS 501: Software Engineering Fall 1999 Lecture 12 System Architecture III Distributed Objects.
Lecture 5 Page 1 CS 111 Online Processes CS 111 On-Line MS Program Operating Systems Peter Reiher.
Plug-in Architectures Presented by Truc Nguyen. What’s a plug-in? “a type of program that tightly integrates with a larger application to add a special.
Chapter 5 Introduction To Form Builder. Lesson A Objectives  Display Forms Builder forms in a Web browser  Use a data block form to view, insert, update,
Component Patterns – Architecture and Applications with EJB copyright © 2001, MATHEMA AG Component Patterns Architecture and Applications with EJB Markus.
Chapter 1 Basic Concepts of Operating Systems Introduction Software A program is a sequence of instructions that enables the computer to carry.
Chapter 18 Object Database Management Systems. Outline Motivation for object database management Object-oriented principles Architectures for object database.
Slide 1 Chapter 8 Architectural Design. Slide 2 Topics covered l System structuring l Control models l Modular decomposition l Domain-specific architectures.
Programming Languages Concepts Chapter 1: Programming Languages Concepts Lecture # 4.
Advance Computer Programming Market for Java ME The Java ME Platform – Java 2 Micro Edition (J2ME) combines a resource- constrained JVM and a set of Java.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Applications Active Web Documents Active Web Documents.
Architecture Components
PHP Training at GoLogica in Bangalore
PHP / MySQL Introduction
CMPE419 Mobile Application Development
Ch > 28.4.
Copyright © 2011 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 2 Database System Concepts and Architecture.
Software Architecture
Analysis models and design models
An Introduction to Software Architecture
The Islamia University Bahawalpur
Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta
Combining Compile-Time and Run-Time Components
Java History, Editions, Version Features
Outcome of the Lecture Upon completion of this lecture you will be able to understand Fundamentals and Characteristics of Java Language Basic Terminology.
Presentation transcript:

TOP Rinus Plasmeijer – Bas Lijnse - Peter Achten Pieter Koopman - Steffen Michels - Jurrien Slutterheim (TNO-RU) Jan Martin Jansen (NLDA) - Laszlo Domoszlai (ELTE) Radboud University Nijmegen 1

Task Oriented Programming Rinus Plasmeijer – Bas Lijnse - Peter Achten Pieter Koopman - Steffen Michels - Jurrien Slutterheim (TNO-RU) Jan Martin Jansen (NLDA) - Laszlo Domoszlai (ELTE) Radboud University Nijmegen 2

3 From Workflow Specifications in FP to TOP How can we define nicely - workflows management systems in a pure FP ? - multi-user web based GUI applications ? - merge sever-side and client-side evaluation ? - the management of tasks, as a task ? - soft real-time complex collaborations, e.g. support for crisis management ? TOP

4 Why Task Oriented Programming ? Tasks are a common notion in daily life / in any organization  People increasingly work together distributively on the internet  Focus on complex collaborations, arbitrary ways of working  (sub) tasks and their interdependencies are dynamically determined  Any kind of task (involving computers) should be expressible  Huge Application Area  CC2, Crisis management, (e) Health Care, Insurance Market, Systems for Economical Market, (e) Government, Legal Systems, ERP, Social Media Tasks are useful building blocks when developing software  function call, procedure call, method invocation, calling a web-service, a query  web form handling, handling  process, thread, “app” Tasks are suited to communicate ideas between Domain Expert – TOP Programmer

Task Oriented Programming New style of (functional) programming Tasks as basic building blocks Reactive system Declarative High level of abstraction No worry about technical realization ! Yields application coordinating the work of collaborating people & systems But, it can also be used for Rapid Prototyping to formalize how work should be organized to investigate different ways of doing work using simulation with agents for training: mix of real people and agents to check properties by testing, analysis or by formal proof (semantics formally defined) to communicate desired ways of working between domain experts and programmers 5

- implementation of TOP Domain Specific Programming Language, embedded in “just” another Combinator Library Abstracts as much technical stuff as possible (thanks to generic functions): graphical user interfaces & handling of user-interaction persistent storage of information (client-server) communication evaluation on client informing tasks about the progress in tasks others work on informing tasks when shared information is changed Yields Web-Service coordinating the tasks to be done… Tasks can run on server, on client, or on both Clean is standard compiled twice: 1. to native code (Windows, Mac-OS, Linux) 2. to SAPL, and just-in-time on demand by client to javascript 6

My iTask Specification iTasks Architecture 7

iTask Web Server iTask Combinator Library My iTask Specification iTasks Architecture 8

WEB iTask Web Server iTask Combinator Library My iTask Specification iTask Web Server iTask Combinator Library iTask Specification Web Service RPC Computer iTask User iTask Client iTask User iTask App Laptop iTask Client Phone iTask User iTask Client Cloud / Database Tablet iTask User iTask Client Sensor iTask User iTask Client iTasks Architecture 9

Case study -> Prototype: Coast Guard Search And Rescue 10

Prototype : Vessel Crew Optimization – TNO 11

12 iTask Core Tasks: typed, a task value may change over time Basic tasks: Interactive Tasks: editors Simple Tasks : return, … Foreign stuff: web-service, OS-call, sensors, … Sequential and Parallel Combinators for combining tasks Defines control flow and data flow between tasks Shared Information: one concept for sharing any kind of information + growing iTask Library to support frequently occurring work patterns + Clean pure, higher order, polymorphic, overloaded, generic functions hybrid typing: strongly statically typed + dynamic typing

Task Values :: Task a typed unit of work which should deliver a task result of type a While the task is going on, its value may change over time 13

Task Values :: Task a typed unit of work which should deliver a task result of type a While the task is going on, its value may change over time NoVal 14

Task Values :: Task a typed unit of work which should deliver a task result of type a While the task is going on, its value may change over time NoVal Val a False 15

Task Values :: Task a typed unit of work which should deliver a task result of type a While the task is going on, its value may change over time NoVal Val a False 16

Task Values :: Task a typed unit of work which should deliver a task result of type a While the task is going on, its value may change over time 17

Task Values :: Task a typed unit of work which should deliver a task result of type a While the task is going on, its value may change over time :: TaskResult a= ValRes TimeStamp (Value a) |  e: ExcRes e & iTask e :: Value a = NoVal | Val a Stability :: Stability :== Bool Task values can be observed by other tasks may influence the work of others can be of any type: user defined, higher order (e.g a task or a function) must satisfy the iTask context restriction A Task may raise an exception A Task never finishes (although the work may be done) but its value may not be needed anymore by the environment… 18

Model View 19 Editors module example import iTasks Start :: *World  *World Start world = startEngine myTask world myTask :: Task Int myTask = enterInformation "Enter an integer" [] One can change the value as often as one likes Editors never deliver a Stable value Optional Lens for tuning standard view Persistent

Model View 20 Editors - 2 :: Person = { name :: String, gender :: Gender, dateOfBirth :: Maybe Date} :: Gender =Male | Female derive class iTask Person, Gender myTask :: Task Person myTask = enterInformation "Enter your personal information" []

21 Editors - 3 myTask :: Task [Person] myTask = enterInformation "Please personal information of multiple people" []

22 Editors - 4 simpleEditor :: Task Note simpleEditor = enterInformation "Enter a piece of text" [] chooseDate :: Task Date chooseDate = enterInformation "Choose a date" [] pointOnMap :: Task GoogleMap pointOnMap = enterInformation "Show me the location" [] simpleDraw:: Task SimpleDraw simpleDraw = enterInformation “Make a drawing" []

23 Editors - 5 pizzaWith :: Task [String] pizzaWith = enterMultipleChoice "What do you like on your pizza ?" [] ["Cheese","Tomato","Ansjofish","Salami"]

24 Variant of Interactive Editors Basic tasks: Interactive editor for filling in forms of a certain type: viewInformation :: d [ViewOption a] a  Task a | descr d & iTask a enterInformation :: d [EnterOption a]  Task a | descr d & iTask a updateInformation :: d [UpdateOption a a] a  Task a | descr d & iTask a enterChoice :: d [ChoiceOption o] [o]  Task o | descr d & iTask o updateChoice :: d [ChoiceOption o] [o] o  Task o | descr d & iTask o enterMultipleChoice :: d [MultiChoiceOption o] [o]  Task [o]| descr d & iTask o updateMultipleChoice :: d [MultiChoiceOption o] [o] [o]  Task [o] | descr d & iTask o All instances of one Core editor Options: definable view: between task value type a and arbitrary view type v descr d: can vary from a simple string to html code iTask a : bunch of type driven generic functions for doing the real work

25 Sequential Combinator: >>* palindrome :: Task (Maybe String) palindrome = enterInformation "Enter a palindrome" [] >>* [ OnAction ActionOk (ifValue isPalindrome (\v  return (Just v))), OnAction ActionCancel (always (return Nothing)) ]

26 Sequential Combinator: >>* >>* Observe Task a, continue with one of the Task b's: - if a certain action is performed by the end-user - if the value of the observed task is satisfying a certain predicate - or the observed task has raised an exception to be handled here Task a Task b

Core – Sequential Combinator Combinator for Sequential Composition (>>*) infixl 1 :: (Task a) [TaskStep a b] → Task b | iTask a & iTask b :: TaskStep a b = OnAction Action((Value a) → Maybe (Task b)) | OnValue ((Value a) → Maybe (Task b)) | E.e: OnException (e → Task b) & iTask e :: Action= Action String [ActionOption] :: ActionOption= ActionKey Hotkey | ActionWeight Int | ActionIcon String | ActionTrigger DoubleClick :: Hotkey = { key :: Key, ctrl :: Bool, alt :: Bool, shift :: Bool } ActionOk :== Action "Ok“ [ActionIcon "ok", ActionKey (unmodified KEY_ENTER)] 27

Core – Sequential Combinator Combinator for Sequential Composition (>>*) infixl 1 :: (Task a) [TaskStep a b] → Task b | iTask a & iTask b :: TaskStep a b = OnAction Action((Value a) → Maybe (Task b)) | OnValue ((Value a) → Maybe (Task b)) | E.e: OnException (e → Task b) & iTask e :: Action= Action String [ActionOption] :: ActionOption= ActionKey Hotkey | ActionWeight Int | ActionIcon String | ActionTrigger DoubleClick :: Hotkey = { key :: Key, ctrl :: Bool, alt :: Bool, shift :: Bool } ActionOpen:== Action "/File/Open" [ActionIcon "open", ActionKey (ctrl KEY_O)] 28

Core - Shared Data Sources SDS: one abstraction layer for any type of shared data: easy to use for the progammer - Shared Memory, Files, Database, Time, Sensors, …. - Reading and Writing can be of different type - SDS’s can be composed from others - Tasks depending on an SDS are automatically informed when it is being changed :: RWShared r w :: Shared a :== RWShared a a :: ReadOnlyShared a:== RWShared a Void :: WriteOnlyShared a:== RWShared Void a 29

30 Variants of Interactive Editors viewInformation enterInformation updateInformation enterChoice updateChoice enterMultipleChoice updateMultipleChoice

31 Variants of Interactive Editors viewInformation viewSharedInformation enterInformation updateInformation updateSharedInformation enterChoice enterSharedChoice updateChoice updateSharedChoice enterMultipleChoice enterSharedMultipleChoice updateMultipleChoice updateSharedMultipleChoice All instances of one Core editor: interact :: d (ReadOnlyShared r) (r  (l,v)) (l  r  v  (l,v))  Task l | descr d & iTask l & iTask r & iTask v

Editors on SDS’s viewCurDateTime :: Task DateTime viewCurDateTime = viewSharedInformation "The current date and time is:" [] currentDateTime

Assign task to someone do both tasks in parallel, return value first Editors on SDS’s twoTasks :: a → Task a | iTask a twoTasks v = withShared vdoTasks doTasks :: (Shared a) → Task a | iTask a doTasks sv = updateSharedInformation sv -|| viewSharedInformation sv 33

34 Handy predefined functions based on parallel and : return values of all (embedded) parallel tasks: allTasks :: [Task a]  Task [a] | iTask a (-&&-) infixr 4 :: (Task a) (Task b)  Task (a, b)| iTask a & iTask b or: return result of (embedded) parallel tasks yielding a value as first: eitherTask:: (Task a) (Task b)  Task (Either a b)| iTask a & iTask b anyTask:: [Task a]  Task a| iTask a (-||-) infixr 3 :: (Task a) (Task a)  Task a | iTask a one-of: start two tasks, but we are only interested in the result of one of them, use the other to inform: (||-) infixr 3:: (Task a) (Task b)  Task b| iTask a & iTask b (-||) infixl 3:: (Task a) (Task b)  Task a | iTask a & iTask b assign a task to a specific user: infix 3 :: User (Task a)  Task a | iTask a All instances of one Core parallel task combinator: parallel :: d [(ParallelTaskType, (ReadOnlyShared (TaskList a))  Task a)]  Task [(TaskTime, TaskValue a)] | descr d & iTask a

35 Standard iTask Client

36 Incidone – Coast Guard Search and Rescue Support

Semantics - What is a Task ? :: Task a:== Event → *State → *((Reduct a, [(TaskNo, Response)]), *State) :: Reduct a=Reduct (TaskResult a) (Task a) rewrite :: (Task a) → *State → *(Maybe a, *State) | iTask a rewrite task st # (ev, world)= getNextEvent st.world # (t, world) = getCurrentTime world # ((Reduct result ntask, responses), st) = task ev {st & timeStamp = t, world = world} = case result of ValRes _ (Val a Stable) → (Just a, st) ExcRes _ → (Nothing, st) _ → rewrite ntask {st & world = informClients responses st.world} Current Value Remaining Task To do 37

Conclusions Task Oriented Programming New style of programming for implementing multi-user web applications Focusing on tasks, not on the underlying technology All source code in one language Core reactive tasks working on local and shared data shared data sources abstracting from any type of shared data editor: can handle all interactions sequential and parallel combinators Operational Semantics defined in Clean readable, concise, type-checked, executable blueprint for implementations 38

39 Future Work Real real-world applications Coast Guard TNO Vessel Crew Applicability efficiency, scalability, security, version management, collaboration existing systems… Parallel & distributed servers Simulation What is the best way to do the work ? Can we do the work with less resources ? How to communicate task specifications with Domain Experts, End-Users ? Graphical Representations of iTasks, … Semantics Reasoning ? Proving ? Testing ?

Questions ? 40

41 Papers on iTasks First paper on iTasks: iTasks: Executable Specifications of Interactive Work Flow Systems for the Web(ICFP 2007) Extensions: iTasks for a change - Type-safe run-time change in dynamically evolving workflows(PEPM 2011) GiN: a graphical language and tool for defining iTask workflows(TFP 2011) iTask as a new paradigm for building GUI applications (IFL 2010) Getting a grip on tasks that coordinate tasks (LDTA 2011) Semantics: An Executable and Testable Semantics for iTasks (IFL 2008)  Task Oriented Programming in a Pure Functional Language(PPDP 2012) Client site evaluation of tasks: Transparant Ajax and Client-Site Evaluation of iTasks (IFL 2007) iEditors: Extending iTask with Interactive Plug-ins(IFL 2008) Applicability: A Conference Management System based on the iData Toolkit(IFL 2007) Web Based Dynamic Workflow Systems for C2 of Military Operations (ICCRTS 2010) Managing COPD exacerberations with telemedicine(AIME 2010) Towards Dynamic Workflows for Crisis Management(ISCRAM 2010) Capturing the Netherlands Coast Guard's SAR Workflow with iTasks (ISCRAM 2011) A Task-Oriented Incident Coordination Tool(ISCRAM 2012)

Shared Data Sources Creating an SDS: withShared :: a ((Shared a) → Task b) → Task b | iTask b// Shared memory sharedStore :: String a → Shared a | iTask a// Special File externalFile :: FilePath → Shared String // Ordinary File sqlShare :: SQLDatabase String … → ReadWriteShared r w // SQL Database Reading an SDS: get :: (RWShared r w) → Task r | iTask r// read once currentTime:: ReadOnlyShared Time currentDate:: ReadOnlyShared Date currentDateTime:: ReadOnlyShared DateTime currentUser:: ReadOnlyShared User users:: ReadOnlyShared [User] Updating an SDS: set :: w (RWShared r w) → Task w | iTask w // write once update :: (r → w) (RWShared r w) → Task w | iTask r & iTask w 42