AP 01/01 Interface Definition Language Types are problematic: –Weakly typed C language: short / int / long –Architecture-specific data types IDL is a strongly.

Slides:



Advertisements
Similar presentations
Introduction to Linked Lists In your previous programming course, you saw how data is organized and processed sequentially using an array. You probably.
Advertisements

Programming Languages and Paradigms
Coding Standard: General Rules 1.Always be consistent with existing code. 2.Adopt naming conventions consistent with selected framework. 3.Use the same.
Names and Bindings.
The Spring System (and its trusty sidekick, Subcontract) Sun Microsystems.
CS6223: Distributed Systems Remote Procedure Call (RPC)
CORBA Architecture Nitin Prabhu. Outline CORBA Object Model CORBA Architecture Static Invocation Dynamic Invocation CORBA Communication Model.
PHP Functions and Control Structures. 2 Defining Functions Functions are groups of statements that you can execute as a single unit Function definitions.
AP 01/01 Asynchronous Calls Standard COM+ model is completely synchronous –Emulates standard procedure calls –Problematic in distributed scenarios with.
Copyright © 2006 The McGraw-Hill Companies, Inc. Programming Languages 2nd edition Tucker and Noonan Chapter 5 Types Types are the leaven of computer programming;
Representing Data Elements Gayatri Gopalakrishnan.
IDL Interface Definition Language. IDL products Interface repository Dynamic Interface Static skeletons Client IDL stubs Dynamic skeletons Server Object.
Run time vs. Compile time
Constants. 2 Objectives Describe ways to create constants –const –readonly –enum.
1) Enumerated types 2) Records and structures 3) Accessing fields in records/structures 4) Operations on records/structures 5) Variant records 6) Dynamic.
Primitive Data Types: Numbers Strings Ordinal Types Pointers
Saturday May 02 PST 4 PM. Saturday May 02 PST 10:00 PM.
1 Type Type system for a programming language = –set of types AND – rules that specify how a typed program is allowed to behave Why? –to generate better.
Data Types.
3.1 Documentation & Java Language Elements Purpose of documentation Assist the programmer with developing the program Assist other programers who.
Lecture 03a: C++ classes Topics: basic classes and objects constructor, destructor Miscellaney An intro to the STL (Standard Template Library)
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 19 Clicker Questions November 3, 2009.
Java Implementation: Part 3S CompSci 230 Software Construction.
ISBN Chapter 10 Implementing Subprograms.
Names Variables Type Checking Strong Typing Type Compatibility 1.
3. The Nuts and Bolts of C++ Computer Programming 3. The Nuts and Bolts of C++ 1 Learning the C++ language 3. The Nuts and Bolts of C++ (4)
C Tokens Identifiers Keywords Constants Operators Special symbols.
C-Language Keywords(C99)
COM/DCOM Implementation Basics of: Object creation and access Object Reuse Interface referencing.
COM and DCOM CS 562 February 27, Motivation Data Analyzer Resource Monitor int compute (…) { } int compute (…) { } Data Analyzer int compute (…)
March 12, ICE 1341 – Programming Languages (Lecture #6) In-Young Ko Programming Languages (ICE 1341) Lecture #6 Programming Languages (ICE 1341)
Comp 248 Introduction to Programming Chapter 6 Arrays Part B Dr. Aiman Hanna Department of Computer Science & Software Engineering Concordia University,
1 C - Memory Simple Types Arrays Pointers Pointer to Pointer Multi-dimensional Arrays Dynamic Memory Allocation.
Chapter 0.2 – Pointers and Memory. Type Specifiers  const  may be initialised but not used in any subsequent assignment  common and useful  volatile.
Ni.com Understanding COM/ActiveX Jeff Paulter Staff Software Engineer Thurs Aug 17 10:15-11:30 a.m., 1:45-3:00 p.m. Ash (10A) Jeff Paulter Staff Software.
Arrays Part 9 dbg. Arrays An array is a fixed number of contiguous memory locations, all containing data of the same type, identified by one variable.
Copyright 2003 Scott/Jones Publishing Standard Version of Starting Out with C++, 4th Edition Chapter 11 Structured Data.
Array in C++ / review. An array contains multiple objects of identical types stored sequentially in memory. The individual objects in an array, referred.
Java Programming: Program Design Including Data Structures 1 Vectors The class Vector can be used to implement a list Unlike an array, the size of a Vector.
CPSC 252 Dynamic Memory Allocation Page 1 Dynamic memory allocation Our first IntVector class has some serious limitations the capacity is fixed at MAX_SIZE.
Data TypestMyn1 Data Types The type of a variable is not set by the programmer; rather, it is decided at runtime by PHP depending on the context in which.
ISBN Chapter 6 Data Types Introduction Primitive Data Types User-Defined Ordinal Types.
Types(1). Lecture 52 Type(1)  A type is a collection of values and operations on those values. Integer type  values..., -2, -1, 0, 1, 2,...  operations.
Chapter 6 Introduction to Defining Classes. Objectives: Design and implement a simple class from user requirements. Organize a program in terms of a view.
1 Developing Application in Distributed Computing Environment (DCE)
Copyright © 2012 Pearson Education, Inc. Chapter 11: Structured Data.
The Cn Language over view The Cn language strongly on ANSI C. So if you are familiar with ANCI it is not so tough to deal with Cn language. Basic Data.
Remote Procedure Calls CS587x Lecture Department of Computer Science Iowa State University.
Data Structure and c K.S.Prabhu Lecturer All Deaf Educational Technology.
Copyright © 2006 Pearson Addison-Wesley. All rights reserved This Weeks Topics: Pointers (continued)  Modify C-String through a function call 
 In the java programming language, a keyword is one of 50 reserved words which have a predefined meaning in the language; because of this,
Weekly C-minar Week 0. Today: Steps of the compile Basic inclusion/syntax rules Low-cost containment Debugging.
CS201 – Introduction to Computing – Sabancı University 1 Built-in Arrays l C++ native array type (not the class version) l Two versions ä fixed size arrays.
CSci 162 Lecture 2 Martin van Bommel. Enumeration –process of listing all of the elements in the domain of a type Enumerated type –type defined via enumeration.
Array Declarations Arrays contain a fixed number of variables of identical type Array declaration and allocation are separate operations Declaration examples:
Introduction to C# By: Abir Ghattas Michel Barakat.
BUILDING JAVA PROGRAMS CHAPTER 7 Arrays days until the AP Computer Science test.
Pointers A pointer type variable holds the address of a data object or a function. A pointer can refer to an object of any one data type; it cannot refer.
Array contiguous memory locations that have the same name and type. Note: an array may contain primitive data BUT an array is a data structure a collection.
Procedure Definitions and Semantics Procedures support control abstraction in programming languages. In most programming languages, a procedure is defined.
BASIC C PROGRAMMING LANGUAGE TUTORIAL infobizzs.com.
Java and C# - Some Commonalities Compile into machine-independent, language- independent code which runs in a managed execution environment Garbage Collection.
Lecture 5: RPC (exercises/questions). 26-Jun-16COMP28112 Lecture 52 First Six Steps of RPC TvS: Figure 4-7.
Chapter VII: Arrays.
Data Types In Text: Chapter 6.
Interface Definition Language
CSCI 3370: Principles of Programming Languages Chapter 9 Subprograms
Lecture 4: RPC Remote Procedure Call Coulouris et al: Chapter 5
Lecture 4: RPC Remote Procedure Call CDK: Chapter 5
Cs212: Data Structures Computer Science Department Lecture 2: Arrays.
Presentation transcript:

AP 01/01 Interface Definition Language Types are problematic: –Weakly typed C language: short / int / long –Architecture-specific data types IDL is a strongly typed language –Concretely defined sizes for base types IDL uses Network Data Representation (NDR) –Architecture-independent network transmissions

AP 01/01 Enumerated Types Enum keyword –Enums are transmitted as 16-bit values per default –[v1_enum] attribute generates 32-bit entities Interface IWeek: IUnknown { typedef [v1_enum] enum DaysOfTheWeek { Monday, Tuesday, Wednesday, Thursday, Friday, Saturday, Sunday } DaysOfTheWeek; HRESULT Test(DaysOfTheWeek day); }

AP 01/01 Directional Attributes Which variables need to sent to server? C++ does not indicate whether function changes pointer variables Attributes: –[in], [out], [in, out] –[in, out] models standard C++ behavior (extra network traffic) –[in] is default

AP 01/01 Arrays Fixed Arrays Conformant Arrays –Several attributes to define size of arrays and data transmitted: –First_is, last_is, length_is, max_is, min_is, size_is –Caller specifies actual number of elements at runtime Varying arrays –Server may return less than the full number of elements –Maximum number of elements is bounded Open arrays –Caller/callee control size of memory blocks separately Multidimensional Arrays

AP 01/01 Character Arrays Common programming practice... –Special [string] attribute HRESULT SendString1([in, string] wchar_t * myString); HRESULT SendString2([in] int cLength, [in, size_is(cLength)] wchar_t * myString ); –Both versions are semantically equivalent –Client calls: wchar_t wszHello[] = L“My favourite String“; pTest->SendString1( wszHello ); pTest->SendString2( wcslen( wszHello ), wszHello ); –Problem: send/receive a string (memory allocation)

AP 01/01 Pointers Full Pointers (problem of aliasing) –Stub code maintains dictionary of marshaled pointers –Avoid full pointers whenever possible Unique Pointers –Can point to any location –Can have the value null –Can change form non-null to null and vice-versa during a call –IDL ignores changes between non-null values during call –No aliasing

AP 01/01 Pointers (contd.) Reference Pointers –Can point to any location –Cannot have the value null –No aliasing –Cannot change during a call Interface Pointers –C++ class and function pointers are off-limits to remote method calls –Access to code in different address spaces only through interface pointers –Problem: generic IF pointers, MIDL cannot generate stub code for void** –HRESULT GetInterfacePointer([out] IUnknown** ppvObject); –Client needs to call QueryInterface() afterwards

AP 01/01 Interface Pointers (contd.) Use IDL attribute to identify type of IF pointer –HRESULT GetInterfacePointer([in] REFIID riid, [out], iid_is(riid)] void** ppvObject); –Client calls: IMyCustomInterface * pCustomInterface; pObject->GetInterfacePointer( IID_IMyCustomInterface, (void**) pCustomInterface ); Special attributes to map non-remotable methods –[local] – directs MIDL not to generate stub code (for DLLs) –[call_as] – directs MIDL to treat parameter types differently