INF 212 ANALYSIS OF PROG. LANGS PLUGINS. Instructors: Crista Lopes Copyright Instructors.

Similar documents
Classes and Objects 3/28/2017. How can multiple methods within a Java class read and write the same variable?

INF 212 ANALYSIS OF PROG. LANGS CONCURRENCY. Instructors: Crista Lopes Copyright Instructors.

Cost of Your Programs

CS5233 Components Models and Engineering

Information Science. No. For each question, choose one correct answer and write its symbol (A E) in the box.

Making Address Spaces Smaller

1. Go to the URL Click on JDK download option

AP Computer Science Unit 1. Programs

Lec 3. Compilers, Debugging, Hello World, and Variables

INF 212 ANALYSIS OF PROG. LANGS Type Systems. Instructors: Crista Lopes Copyright Instructors.

INF 212 ANALYSIS OF PROG. LANGS SQL AND SPREADSHEETS. Instructors: Crista Lopes Copyright Instructors.

Do not open this examination paper until instructed to do so. Section A: answer all the questions. Section B: answer all the questions.

Misc topics from Statoil. Joakim Hove

Link 8.A Dynamic Linking

INF 212 ANALYSIS OF PROG. LANGS FUNCTION COMPOSITION. Instructors: Crista Lopes Copyright Instructors.

Lecture 02, Fall 2018 Friday September 7

INF 212 ANALYSIS OF PROG. LANGS ITERATORS, GENERATORS AND COROUTINES. Instructors: Crista Lopes Copyright Instructors.

CSC324 Principles of Programming Languages

Link 7. Dynamic Linking

Link native libraries from a.net application

1.00 Lecture 8. Using An Existing Class, cont.

PYTHON IS SLOW. Make it faster with C. Ben Shaw

Multiple file project management & Makefile

INDEX. A SIMPLE JAVA PROGRAM Class Declaration The Main Line. The Line Contains Three Keywords The Output Line

Intel Do-It-Yourself Challenge Robotics Hello World

CS263: Runtime Systems Lecture: High-level language virtual machines

Eclipse. JVM, main method and using Eclipse. Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics

Object-oriented programming. and data-structures CS/ENGRD 2110 SUMMER 2018

Check the entries in the home directory again with an ls command and then change to the java directory:

Mobile Opportunities for the Open Source Community

Even though we created a folder for the workspace, we still have to let JCreator do the same. So click File, New, and then Blank Workspace.

Packaging Your Program into a Distributable JAR File

Introduction. Lecture 1 MIT 12043, Fundamentals of Programming By: S. Sabraz Nawaz

C# Generics. Object Oriented Programming (236703) Winter

CHAPTER 1 Introduction to Computers and Java

Introduction. Introduction to OOP with Java. Lecture 01: Introduction to OOP with Java - AKF Sep AbuKhleiF -

Making Dynamic Instrumentation Great Again

INF 212 ANALYSIS OF PROG. LANGS PROCEDURES & FUNCTIONS. Instructors: Kaj Dreef Copyright Instructors.

CSE 201 JAVA PROGRAMMING I. Copyright 2016 by Smart Coding School

(A) 99 (B) 100 (C) 101 (D) 100 initial integers plus any additional integers required during program execution

Introduction to Java Unit 1. Using BlueJ to Write Programs

Introduction to OOP with Java. Instructor: AbuKhleif, Mohammad Noor Sep 2017

COMP 2718: The OS, Shell, Terminal, and Text

Introduction to Programming: Variables and Objects. HORT Lecture 7 Instructor: Kranthi Varala

Making Xbase Look Like Java

Designing for Modularity with Java 9

S8352: Java From the Very Beginning Part I - Exercises

Configuration for Microprofile. Mark Struberg, Emily Jiang, John D. Ament

Interpreted vs Compiled. Java Compile. Classes, Objects, and Methods. Hello World 10/6/2016. Python Interpreted. Java Compiled

Homework 6. Yuji Shimojo CMSC 330. Instructor: Prof. Reginald Y. Haseltine

Very similar to Java C++ C-Based syntax (if, while, ) object base class no pointers, object parameters are references All code in classes

Java and OOP. Part 2 Classes and objects

(A) 99 ** (B) 100 (C) 101 (D) 100 initial integers plus any additional integers required during program execution

ECE 2400 / ENGRD 2140 Computer Systems Programming Course Overview

COMP-202. Recursion. COMP Recursion, 2011 Jörg Kienzle and others

CS 152: Data Structures with Java Hello World with the IntelliJ IDE

Abstract Classes Interfaces CSCI 201 Principles of Software Development

Abstract Classes Interfaces CSCI 201 Principles of Software Development

Lecture 1 - Introduction (Class Notes)

INF 212/CS 253 Type Systems. Instructors: Harry Xu Crista Lopes

In this tutorial, we will understand how to use the OpenNLP library to build an efficient text processing service.

COMP 110/L Lecture 13. Kyle Dewey

MRCP. Installation Manual. Developer Guide. Powered by Universal Speech Solutions LLC

Expanded Guidelines on Programming Style and Documentation

CSC 103: Ho. Spring 2016 Smith Colle Prof. Sheeh

C and Java some big differences

Operating Systems CMPSCI 377, Lec 2 Intro to C/C++ Prashant Shenoy University of Massachusetts Amherst

Install and Configure ANTLR 4 on Eclipse and Ubuntu

No Source Code. EEC 521: Software Engineering. Specification-Based Testing. Advantages

Tutorial 1 CSC 201. Java Programming Concepts عؾادئماظربجمةمبادؿكدامماجلاصا

Lowering and Backend in libfirm

Algorithms: Design & Practice

The Singleton Pattern. Design Patterns In Java Bob Tarr

INF160 IS Development Environments

LOADING LIBRARY FILES IN C++

Produced by. Design Patterns. MSc in Computer Science. Eamonn de Leastar

Object Oriented Programming

Chapter 0 : MVC review / Threading & Concurrency. CSCI 251 Android App Development

Frustrated by all the hype?

Array. Array Declaration:

The Trouble with Types

4. Dynamic Linking. Summary. DLL structure ECOM

Transitioning from Spread 3.17.x to Spread 4.0

AP Computer Science Unit 1. Writing Programs Using BlueJ

Black Box Testing. EEC 521: Software Engineering. Specification-Based Testing. No Source Code. Software Testing

enum Types 1 1 The keyword enum is a shorthand for enumeration. Zheng-Liang Lu Java Programming 267 / 287

! Learn how to think like a computer scientist. ! Learn problem solving. ! Read and write code. ! Understand object oriented programming

CSI32 Object-Oriented Programming

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:

C212 Early Evaluation Exam Mon Feb Name: Please provide brief (common sense) justifications with your answers below.

Lab 1: Introduction to C Programming. (Creating a program using the Microsoft developer Studio, Compiling and Linking)

Chapter 11 Introduction to Programming in C

ROBOT NETWORKING: USING NETWORKTABLES

Chapter 1 Getting Started

You should see something like this, called the prompt :

INF 212 ANALYSIS OF PROG. LANGS ELEMENTS OF IMPERATIVE PROGRAMMING STYLE. Instructors: Crista Lopes Copyright Instructors.

COMP 110/L Lecture 6. Kyle Dewey

Programming by Delegation

Chapter 11 Introduction to Programming in C

Advanced Topics in Java and on Security in Systems Effective Generics. Eirik Eltvik 26 th of February 2007

Transcription:

INF 212 ANALYSIS OF PROG. LANGS PLUGINS Instructors: Crista Lopes Copyright Instructors.

Modules as conceptual units

Modules as physical components

Software modules as physical components Source components Get the source, make it yours. Simple. Binary components Java: jar files.net: DLL files C/C++: so files... Not so simple

Source vs. Binary Discuss

Linking binary components 3 steps 1. Independent compilation 2. Dynamic Loading 3. Instantiation of classes

Linking binary components Dynamically-typed languages Simple Statically-typed languages Not so simple Discuss

Binary components -- Python 1 #!/usr/bin/env python 2 import sys, ConfigParser, imp 3 4 def load_plugins(): 5 config = ConfigParser.ConfigParser() 6 config.read("config.ini") 7 words_plugin = config.get("plugins", "words") 8 frequencies_plugin = config.get("plugins", "frequencies") 9 global tfwords, tffreqs 10 tfwords = imp.load_compiled( tfwords, words_plugin) 11 tffreqs = imp.load_compiled( tffreqs, frequencies_plugin) 12 13 load_plugins() 14 word_freqs = tffreqs.top25(tfwords.extract_words(sys.argv[1])) 15 16 for (w, c) in word_freqs: 17 print w, -, c

Binary components Python Python No need to worry about types during independent compilation

Binary components Typed class TFApp { static void main(string[] args) { HashMap<String, int> wordfreqs; wordfreqs = tffreqs.top25(tfwords.extract_words(sys.argv[0])); Types?

Binary components Typed interface TFWords { public List<String> extractwords(string path); interface TFFreqs { public HashMap<String, int> top25(list<string> words); class TFApp { static void main(string[] args) { HashMap<String, int> wordfreqs; TFWords tfwords; //=??? TFFreqs tffreqs ;//=??? wordfreqs = tffreqs.top25(tfwords.extract_words(sys.argv[0])); Types ok!

Binary components Typed TFApplication <<interface>> TFWords <<interface>> TFFreqs Words1 Words2 Freqs1 Freqs2 How do we partition into jars?

Physical modularization 1 Typed TFApplication pack1 Compilation dependencies: pack1? pack2? same <<interface>> TFWords <<interface>> TFFreqs Words1 Words2 Freqs1 Freqs2 pack2 pack3 pack4 pack5

Physical modularization 2 Java TFApplication <<interface>> TFWords Words1 Words2 pack3 pack4 pack1 Compilation dependencies: pack1? pack2? pack3? <<interface>> TFFreqs pack2 Freqs1 Freqs2 pack5 pack6

Physical modularization 3 Typed <<interface>> TFWords TFApplication Compilation dependencies: pack1? pack2? pack3? Words1 pack2 Words2 pack1 <<interface>> TFFreqs Freqs1 Freqs2 pack3

Physical modularization 4 Typed <<interface>> TFWords Words1 pack3 TFApplication Words2 pack1 <<interface>> TFFreqs Freqs1 Compilation dependencies: pack1? pack2? pack3? pack2 Freqs2 pack4

Physical modularization 5 Typed TFApplication pack1 <<interface>> TFWords <<interface>> TFFreqs pack2 Words1 Words2 Freqs1 Freqs2 Compilation dependencies: pack1? pack2??????

Linking binary components 3 steps Independent compilation Dynamic Loading Instantiation of classes

Binary components Typed interface TFWords { public List<String> extractwords(string path); interface TFFreqs { public HashMap<String, int> top25(list<string> words); class TFApp { static void main(string[] args) { HashMap<String, int> wordfreqs; TFWords tfwords; //=??? TFFreqs tffreqs ;//=??? wordfreqs = tffreqs.top25(tfwords.extract_words(sys.argv[0]));

Binary components Typed class TFApp { static void main(string[] args) { HashMap<String, int> wordfreqs; TFWords tfwords = new Words1(); TFFreqs tffreqs = new Freqs1(); wordfreqs = tffreqs.top25(tfwords.extract_words(sys.argv[0]));????? Coupling between physical components! TFApp needs one of the other components in order to compile!

Binary components Typed class TFApp { static void main(string[] args) { HashMap<String, int> wordfreqs; TFWords tfwords = create instance dynamically (... ); TFFreqs tffreqs = create instance dynamically (... ); wordfreqs = tffreqs.top25(tfwords.extract_words(sys.argv[0])); You need to research how to do it in your language of choice Given by.ini file

Dynamic loading of libraries Java: ClassLoader class.net Assembly class Raw C++, Linux: dlopen, dlsym, dlclose Raw C++, Win32 LoadLibrary()

Linking binary components 3 steps Independent compilation Dynamic Loading Instantiation of classes

Instantiation Java Class.forName(... ).newinstance();.net Activator.CreateInstance(type) Raw C++?? Factory pattern in linked lib, maybe??

Linking binary components 3 steps Independent compilation Dynamic Loading Instantiation of classes