Advanced Programming Giuseppe Attardi Dipartimento di Informatica Università di Pisa.

Slides:



Advertisements
Similar presentations
.NET Technology. Introduction Overview of.NET What.NET means for Developers, Users and Businesses Two.NET Research Projects:.NET Generics AsmL.
Advertisements

COM vs. CORBA.
Programming Paradigms Introduction. 6/15/2005 Copyright 2005, by the authors of these slides, and Ateneo de Manila University. All rights reserved. L1:
Advanced Programming Giuseppe Attardi Dipartimento di Informatica Università di Pisa.
CIM2564 Introduction to Development Frameworks 1 Overview of a Development Framework Topic 1.
Introduction To System Analysis and Design
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
Overview of the.NET Framework. What is the.NET Framework A new computing platform designed to simplify application development A consistent object-oriented.
CS 501: Software Engineering Fall 2000 Lecture 16 System Architecture III Distributed Objects.
Fast Track to ColdFusion 9. Getting Started with ColdFusion Understanding Dynamic Web Pages ColdFusion Benchmark Introducing the ColdFusion Language Introducing.
Reasons to study concepts of PL
Scripting Languages For Virtual Worlds. Outline Necessary Features Classes, Prototypes, and Mixins Static vs. Dynamic Typing Concurrency Versioning Distribution.
Programming Languages Structure
Software Engineering Module 1 -Components Teaching unit 3 – Advanced development Ernesto Damiani Free University of Bozen - Bolzano Lesson 2 – Components.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
1 An Introduction to Visual Basic Objectives Explain the history of programming languages Define the terminology used in object-oriented programming.
C++ fundamentals.
Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department Asst.Prof.Dr.Ahmet Ünveren SPRING Computer Engineering Department.
Tahir Nawaz Visual Programming C# Week 2. What is C#? C# (pronounced "C sharp") is an object- oriented language that is used to build applications for.
.NET, and Service Gateways Group members: Andre Tran, Priyanka Gangishetty, Irena Mao, Wileen Chiu.
Windows.Net Programming Series Preview. Course Schedule CourseDate Microsoft.Net Fundamentals 01/13/2014 Microsoft Windows/Web Fundamentals 01/20/2014.
A Free sample background from © 2001 By Default!Slide 1.NET Overview BY: Pinkesh Desai.
©Ian Sommerville 2004Software Engineering, 7th edition. Chapter 18 Slide 1 Software Reuse.
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.
VS.NET Syllabus By Peter Huang.
1 8/29/05CS360 Windows Programming Professor Shereen Khoja.
Microsoft Visual Basic 2005: Reloaded Second Edition
1 CSC 427: Data Structures and Algorithm Analysis Fall 2011 See online syllabus (also available through BlueLine): Course goals:
CIS 375—Web App Dev II Microsoft’s.NET. 2 Introduction to.NET Steve Ballmer (January 2000): Steve Ballmer "Delivering an Internet-based platform of Next.
Ceg860 (Prasad)L6MR1 Modularity Extendibility Reusability.
Programming in Java Unit 2. Class and variable declaration A class is best thought of as a template from which objects are created. You can create many.
CS 390- Unix Programming Environment CS 390 Unix Programming Environment Topics to be covered: Distributed Computing Fundamentals.
.NET Framework Danish Sami UG Lead.NetFoundry
Introduction To System Analysis and Design
January 25, 2006copyright Thomas Pole , all rights reserved 1 Software Reuse: History 1980 to 2005 History: Changes to Software Reuse Driven by.
1 Introduction Programming Language Design and Implementation (4th Edition) by T. Pratt and M. Zelkowitz Prentice Hall, 2001 Sections
Copyright © 2007 Addison-Wesley. All rights reserved.1-1 Reasons for Studying Concepts of Programming Languages Increased ability to express ideas Improved.
Guided Notes Ch. 9 ADT and Modules Ch. 10 Object-Oriented Programming PHP support for OOP and Assignment 4 Term project proposal C++ and Java Designer.
1 CSC 222: Computer Programming II Spring 2004 See online syllabus at: Course goals:
1 CSC 427: Data Structures and Algorithm Analysis Fall 2010 See online syllabus (also available through BlueLine): Course goals:
1 CSC 222: Object-Oriented Programming Spring 2013 Course goals:  To know and use basic Java programming constructs for object- oriented problem solving.
Frameworks CompSci 230 S Software Construction.
1 CSC 427: Data Structures and Algorithm Analysis Fall 2006 See online syllabus (also available through Blackboard): Course goals:
Architecture View Models A model is a complete, simplified description of a system from a particular perspective or viewpoint. There is no single view.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 JSP Application Models.
Introduction Mehdi Einali Advanced Programming in Java 1.
Singleton Academy, Pune. Course syllabus Singleton Academy Pune – Course Syllabus1.
Scott C. Johnson Lecturer Rochester Institute of Technology Spring 2016.
Sung-Dong Kim, Dept. of Computer Engineering, Hansung University Java - Introduction.
Introduction to the Microsoft.NET Framework Chris Wastchak Student Ambassador to Microsoft.
.NET Omid Darroudi.
CSC 222: Object-Oriented Programming
CSC 222: Object-Oriented Programming
Basic 1960s It was designed to emphasize ease of use. Became widespread on microcomputers It is relatively simple. Will make it easier for people with.
Why study programming languages?
CSC 222: Object-Oriented Programming
Object-Orientated Programming
Types of Programming Languages
CMPE419 Mobile Application Development
Module 1: Getting Started
Giuseppe Attardi Dipartimento di Informatica Università di Pisa
Programming Languages 2nd edition Tucker and Noonan
Review CSE116 2/21/2019 B.Ramamurthy.
Quality Assurance for Component-Based Software Development
강의 내용 및 방법 접근방법 리포트 시험 Lambda Calculus, Proof of Correctness
Programming Languages, Preliminaries, History & Evolution
CMPE419 Mobile Application Development
Presentation transcript:

Advanced Programming Giuseppe Attardi Dipartimento di Informatica Università di Pisa

Language is an instrument of human reason, not merely a medium for the expression of thought. G. Boole, An Investigation of the Laws of Thought, 1854

Instructors Giuseppe Attardi Office: 292 Mail: Haoyuan Li Office: 373 Mail:

Introduction Programming in the 21 century Programming in the 21 century Software as complex as ever Software as complex as ever Command line interface not enough Command line interface not enough Data must be structured in a DB Data must be structured in a DB Single computer not enough Single computer not enough Software development is a group activity Software development is a group activity

Requirements Cannot start from scratch Cannot start from scratch Reusable components are needed Reusable components are needed OS + libraries not enough OS + libraries not enough

Elements of a Solution Software Framework Software Framework Component Model Component Model Execution Environment Execution Environment

More Complex Software Object-Oriented Programming allows ever larger applications to be built Object-Oriented Programming allows ever larger applications to be built Require increased high-level application and system oversight Require increased high-level application and system oversight Multi-tier applications development increases the choices on how to build applications Multi-tier applications development increases the choices on how to build applications A new Software Architect Role is needed A new Software Architect Role is needed

Software Architect Creating, defining or choosing an application framework Creating, defining or choosing an application framework Creating the component design Creating the component design Structure a complex application into pieces Structure a complex application into pieces Understand the interactions and dependencies among components Understand the interactions and dependencies among components Select the platform based on cost/performance criteria Select the platform based on cost/performance criteria Organize and supervise the “construction site” Organize and supervise the “construction site”

Application Framework A software framework used to implement the standard structure of an application for a specific development environment A software framework used to implement the standard structure of an application for a specific development environment

Software Framework A collection of common code providing generic functionality that can be selectively overridden or specialized by user code providing specific functionality A collection of common code providing generic functionality that can be selectively overridden or specialized by user code providing specific functionality Frameworks, like software libraries, provide reusable abstractions of code wrapped in a well-defined API Frameworks, like software libraries, provide reusable abstractions of code wrapped in a well-defined API

Framework Features Inversion of control Inversion of control –unlike in libraries, the overall program's flow of control is not dictated by the caller, but by the framework –Hollywood Principle: Don’t call us, we’ll call you Default behavior Default behavior Extensibility: usually by selective overriding Extensibility: usually by selective overriding Non-modifiable framework code Non-modifiable framework code

OO Software Framework Object-oriented programming frameworks consists in a set of abstract classes Object-oriented programming frameworks consists in a set of abstract classes An application can be built simply inheriting from pre-existing classes in the framework An application can be built simply inheriting from pre-existing classes in the framework Instantiation of a framework consists of composing and subclassing the existing classes Instantiation of a framework consists of composing and subclassing the existing classes

Examples of Frameworks GUI GUI –MFC –Gnome –Qt General General –Spring Web Web –ASP.Net –GWT –Rails

Benefits of Frameworks Drives solution Drives solution –Dictates how to fill-in-the-blanks Helps solving recurring problems Helps solving recurring problems –Designed for reuse –High value, since reduces cost of development

Framework Design Intellectual Challenging Task Intellectual Challenging Task Requires a deep understanding of the problem domain Requires a deep understanding of the problem domain Requires mastering of software patterns, OO methods and polymorphism in particular Requires mastering of software patterns, OO methods and polymorphism in particular

Course Objectives Understand programming language technology: Understand programming language technology: –Execution Models –Run-time Analyze programming metaphors: Analyze programming metaphors: –Objects –Components –Pattern Learn advanced programming techniques Learn advanced programming techniques Understand their limits ad how to overcome them Understand their limits ad how to overcome them

Course Objectives Explain how high level programming concepts and metaphors map into executable systems and which are their costs and limitations Explain how high level programming concepts and metaphors map into executable systems and which are their costs and limitations Acquaint with modern principles, techniques, and best practices of advanced software construction Acquaint with modern principles, techniques, and best practices of advanced software construction Introduce techniques of programming at higher abstraction levels, in particular generative programming, component programming and web computing Introduce techniques of programming at higher abstraction levels, in particular generative programming, component programming and web computing Present state-of-the-art frameworks incorporating these techniques Present state-of-the-art frameworks incorporating these techniques

Syllabus

Programming Language Foundations Syntax, Parsing, Abstract Syntax Tree, Parser Generators Syntax, Parsing, Abstract Syntax Tree, Parser Generators Names, Scope, Binding Names, Scope, Binding Parameter Passing Parameter Passing Static and Dynamic Allocaltion: Stack, Heap Static and Dynamic Allocaltion: Stack, Heap Types, Inheritance, Polymorphism, Overloading Types, Inheritance, Polymorphism, Overloading Delegates, Closures Delegates, Closures Exception Handling Exception Handling

Run-time Systems Virtual Execution Environment Virtual Execution Environment –Memory Management –Thread Management –Exception Handling –Security –Debugging Support –AOT and JIT Compilation –Dynamic Link/Load –Reflection –Verification Language Interoperability Language Interoperability

Advanced Techniques Generic Programming Generic Programming –C++ templates –C# Generics –Java Generics Generative Programming Generative Programming –Metaprogramming –Reflection –Template –Aspect Oriented Programming –Generators

Interoperability Process level: interprocess communication Process level: interprocess communication Language level: CORBA/IDL Language level: CORBA/IDL Object level: DCOM Object level: DCOM

Component Based Programming COM COM JavaBeans JavaBeans.NET (Assembly, Reflection, Interfaces, Attributes).NET (Assembly, Reflection, Interfaces, Attributes) OSGi OSGi

Web Programming Web Services, SOA Web Services, SOA Web Frameworks Web Frameworks Web 2.0 Web 2.0

Web Services XML, XML-Schema XML, XML-Schema SOAP, RPC, Rest SOAP, RPC, Rest WSDL WSDL UDDI UDDI

Web Frameworks and Applications Asp.Net Asp.Net ADO.Net ADO.Net J2EE J2EE Java Server Faces Java Server Faces AJAX: XHR, YUI, GWT AJAX: XHR, YUI, GWT Mashup and Service Oriented Architecture Mashup and Service Oriented Architecture

Scripting Languages Perl Perl Python Python JavaScript JavaScript PHP PHP

Text Books Programming Language Pragmatics, third ed., Michael L. Scott, Morgan-Kaufmann, Generative Programming: Methods, Tools, and Applications, Krzysztof Czarnecki, Ulrich Eisenecker, Addison-Wesley, Object Thinking, David West, Microsoft Press, 2004.

Assessment Mid Term Paper: early November, one week homework Mid Term Paper: early November, one week homework Term Paper: at the end of the course, one month homework Term Paper: at the end of the course, one month homework

Run-time Environments

Run-Time Environments Java Virtual Machine Java Virtual Machine.NET Common Language Runtime.NET Common Language Runtime Provide a virtual execution environment Provide a virtual execution environment –Exposes a structure organized into elements –Not a simple abstraction of physical resources

Controlling execution Avoid damages Avoid damages Install/uninstall is a nightmare Install/uninstall is a nightmare Component software? Component software?

Benefits Programmers Programmers –Use of library and tools –Shorter integration time –Higher productivity Tool Developers Tool Developers –Avoid the need to care about infrastructure and interoperability Administrators and Users Administrators and Users –Benefit from packages solutions –Independence from processors or OS

Common Language Infrastructure Exposes all items in a unified type system Exposes all items in a unified type system Packages elements in self-describing units Packages elements in self-describing units Loads and resolves interdependencies at runtime Loads and resolves interdependencies at runtime Exposes information that allows verifying the type-safety Exposes information that allows verifying the type-safety Execution Engine enforces politics Execution Engine enforces politics Metadata available at runtime enables dynamic and extensible solutions Metadata available at runtime enables dynamic and extensible solutions

Question Is it feasible to build a runtime common to all programming languages? Is it feasible to build a runtime common to all programming languages?

More in detail Prolog Prolog –How to implement logic variable? –Can one use the Warren-Abstract- Machine? PHP 3 PHP 3 –Why assignment has unusual behavior? LISP LISP –How to handle multiple-values?

Prolog example append(X, Y, Z) :- append(NIL, Y, Y) :- append([A. X], Y, [A. Z] ) :- append(X, Y, Z). :- append([a. b. c], [d. e], R) R = [a. b. c. d. e]

Prolog backtrack :- append(X, Y, [a. b]) :- append(X, NIL, [a. b]) X = NIL Y = [a. b] X = [a] Y = [b] X = [a. b] Y = NIL

PHP Assignement $str = ‘Ciao.’; $str2 = $str; $str{strlen($str) – 1} = ‘!’; echo $str2; $var = $othervar $var = $othervar –Performs copy of the value of $othervar $var = &$othervar $var = &$othervar –Assignment by reference

Control Can we implement tail-recursion in C? Can we implement tail-recursion in C? How to handle synchronization? How to handle synchronization? Function pointers? Function pointers? How to invoke an arbitrary function given a list of arguments? How to invoke an arbitrary function given a list of arguments?

General Function Invoker invoke(fun, argn, arglist) { if (n==0) return f(); return f(); else if (n==1) return f(arg[0]); return f(arg[0]);else return fun(arg[0], arg[1],.., arg[n-1]); return fun(arg[0], arg[1],.., arg[n-1]);}

Basic Data Types Strings in C, Pascal and C++ are different Strings in C, Pascal and C++ are different Array in row or column order? Array in row or column order?

Language Interoperability C# and Cobol bark at each other C# and Cobol bark at each other

C# dog using System; public class Dog { public virtual void RollOver () { Console.WriteLine("Scratch my tummy."); Bark(); } public virtual void Bark () { Console.WriteLine("WOOF WOOF (C#)"); public virtual void Bark () { Console.WriteLine("WOOF WOOF (C#)"); }}

Cobol BigDog CLASS-ID. BigDog INHERITS Dog ENVIRONMENT DIVISION CONFIGURATION SECTION REPOSITORY CLASS Dog OBJECT PROCEDURE DIVISION METHOD-ID. Bark OVERRIDE PROCEDURE DIVISION. DISPLAY "WOOF WOOF (COBOL)" END METHOD Bark END OBJECT END CLASS BigDog.

Barfing dogs public class Demo { public static void Main() { Dog d = new Dog(); BigDog b = new BigDog(); d.RollOver(); b.RollOver(); } }

Final Term Paper Aims at exercising ability to conceive and implement full solutions to a nontrivial problem Aims at exercising ability to conceive and implement full solutions to a nontrivial problem Examples: Examples: –ASP Code generator with regular expression matcher –Implement a DSL for handling persistent object containers –SOAP protocol and SOAP server –Code generator for searching an object DB –Xpath and XSLT Intrepreter –Language for generating network protocols –AJAX Framework

Home Work Develop a simple implementation of primitives: Develop a simple implementation of primitives: –void* malloc(size_t size) –void free(void*) Discuss the limits of the solution Discuss the limits of the solution