Prototype based languages

Similar documents
3G Evolution. OFDM Transmission. Outline. Chapter: Subcarriers in Time Domain. Outline

Defeating a Scarcity Mindset

Red Room Poetry. Find out more at redroomcompany.org

Department of Humanities & Religious Studies Assessment Plan (REV 6/16)

Content Skills Assessments Lessons. Assessments 9/1/2012

IEEE Broadband Wireless Access Working Group <

In this project you ll learn how to create a game in which you have to save the Earth from space monsters.

EECE 301 Signals & Systems Prof. Mark Fowler

EMA5 / UMA5N / FMA5A. V CC -50V -100mA 2.2kW 47kW I C(MAX.) R 1 R 2. Datasheet

Logic Design 2013/9/26. Outline. Implementation Technology. Transistor as a Switch. Transistor as a Switch. Transistor as a Switch

Introduction to Medical Imaging. Signal Processing Basics. Strange Effects. Ever tried to reduce the size of an image and you got this?

DTA123E series V CC I C(MAX.) R 1 R 2. 50V 100mA 2.2k 2.2k. Datasheet. PNP -100mA -50V Digital Transistors (Bias Resistor Built-in Transistors)

Lecture 19: Common Emitter Amplifier with Emitter Degeneration.

CH 7. Synchronization Techniques for OFDM Systems

EMD4 / UMD4N V CC I C(MAX.) R 1 R 2. 50V 100mA. 47kW. V CC -50V -100mA 10kW. Datasheet

90 and 180 Phase Shifter Using an Arbitrary Phase-Difference Coupled-line Structure

The entire devices are built in housings that are protected against liquids and dust without need to be installed in hazloc certified cabinets.

Pip Ahoy! Song Lyrics

EMD3 / UMD3N / IMD3A V CC I C(MAX.) R 1 R 2. 50V 100mA. 10k. 10k. 50V 100mA. 10k. 10k. Datasheet

Assembly Instructions for Model: VMDD26

DTD114GK V CEO I C R. 50V 500mA 10kW. Datasheet. NPN 500mA 50V Digital Transistors (Bias Resistor Built-in Transistors) Outline Parameter Value SMT3

Assembly Instructions for Model: VMAA18

Identifying Basic Level Entities in a Data Graph

UMH8N / IMH8A V CEO I C R 1. 50V 100mA 10k. Datasheet. Outline. Inner circuit

The Trouton Rankine Experiment and the End of the FitzGerald Contraction

Theory and Proposed Method for Determining Large Signal Return Loss or Hot S22 for Power Amplifiers Using Phase Information

CSE 554 Lecture 1: Binary Pictures

j e c t s A m P r o a z i n g P h o t o A guide to running your own 10 week after-school photography club

SECTION ONE: SOCIAL ENTREpRENEURSHIP BEGINS WITH YOU

Pacing Guide for Kindergarten Version GLE Checks for Understanding Vocabulary Envision Textbook Materials

Low Cross-Polarization Slab Waveguide Filter for Narrow-Wall Slotted Waveguide Array Antenna with High Gain Horn

US6H23 / IMH23 V CEO 20V V EBO 12V. 600mA R k. Datasheet. Outline Parameter Tr1 and Tr2 TUMT6 SMT6

Safety Technique. Multi-Function Safety System SAFEMASTER M Output Module With Output Contacts BG 5912

4NPA. Low Frequency Interface Module for Intercom and Public Address Systems. Fig. 4NPA (L- No )

1/24/2017. Electrical resistance

4.5 COLLEGE ALGEBRA 11/5/2015. Property of Logarithms. Solution. If x > 0, y > 0, a > 0, and a 1, then. x = y if and only if log a x = log a y.

Automatic Model View Controller Engineering. Kalle Burbeck Henrik Larsson

On parameters determination of multi-port equivalent scheme for multi-winding traction transformers

Engineering 1620: High Frequency Effects in BJT Circuits an Introduction Especially for the Friday before Spring Break

Engagement Schedule. Schedule M-3 Tutorial. December 07 United States

Lab 12. Speed Control of a D.C. motor. Controller Design

2SA1579 / 2SA1514K. V CEO -120V -50mA I C. Datasheet. PNP -50mA -120V High-Voltage Amplifier Transistors. Outline

ESX10-10x-DC24V-16A-E electronic circuit protector

Graph coloring. Kempe s algorithm removes nodes with < K edges

DETERMINATION OF ELECTRONIC DISTANCE MEASUREMENT ZERO ERROR USING KALMAN FILTER

Introduction to Digital Signal Processing

CATTLE FINISHING RETURN

4-H Action Exhibits. All participants take an equal role in planning and doing the Action Exhibit.

ANALYSIS ON THE COVERAGE CHARACTERISTICS OF GLONASS CONSTELLATION

RETURN TO MAIN MENU ver-increasing computer calculation speed used for games such as Tomb Raider

RECOMMENDATION ITU-R M.1828

SGM Ω, 300MHz Bandwidth, Dual, SPDT Analog Switch

Signals and Systems Fourier Series Representation of Periodic Signals

2. Doodle-Offs: This is everything you ll need to kit out your 3Doodler workshop and facilitate some great. 2 x power strips and extension cords

Common Collector & Common Base Amplifier Circuits

Chapter 2 Fundamentals of OFDM

Towards a Digital Built Britain and beyond

FAN A, 1.2V Low Dropout Linear Regulator for VRM8.5. Features. Description. Applications. Typical Application.

Bi-Directional N-Channel 20-V (D-S) MOSFET

AOZ8904 Ultra-Low Capacitance TVS Diode Array

Migration ATV11 - ATV12

RClamp2451ZA. Ultra Small RailClamp 1-Line, 24V ESD Protection

Controlling formations of multiple mobile robots with inter-robot collision avoidance

Online Publication Date: 15 th Jun, 2012 Publisher: Asian Economic and Social Society. Computer Simulation to Generate Gaussian Pulses for UWB Systems

WIDEBAND SPECTRUM SENSING FOR COGNITIVE RADIO

System and Method for load balancing in Unified Small Cell Router

FMEA: The concept (1) Maintenance Management Concepts and Practices. FMEA: The concept (2) Lecture Objectives. FMEA: The concept (3) Agenda

Fuzzy Anti-Windup Schemes for PID Controllers

GV60 VALORSTAT PLUS OPERATING INSTRUCTIONS. VALORSTAT PLUS GV60 Electronic Ignition Remote Control

HVQFN16 HVQFN (thermal enhanced very thin quad flatpack; no leads) NA (not applicable) P (plastic) MO-220 S (surface mount) Issue date

Dynamic Walking of Biped Robots with Obstacles Using Predictive Controller

CAUTION: Do not install damaged parts!!!

ABSTRACT. KUMAR, MISHA. Control Implementations for High Bandwidth Shunt Active Filter. (Under the direction of Dr Subhashish Bhattacharya).

Precast Products Manual

Exploring Handbells. Techniques & Repertoire for Handbells and Handchimes

WPCA AMEREN ESP. SEMINAR Understanding ESP Controls. By John Knapik. 2004, General Electric Company

AN MIP APPROACH TO THE U-LINE BALANCING PROBLEM WITH PROPORTIONAL WORKER THROUGHPUT. Reyhan Erin Magna PowerTrain Troy, Michigan

Maintain Your F5 Solution with Fast, Reliable Support

A DSP-based Discrete Space Vector Modulation Direct Torque Control of Sensorless Induction Machines

Geometrical Design Concept for Panoramic 3D Video Acquisition

Art Mapping. I=Introduced R=Rehearsed M=Mastered A=Applied

Investigation of Power Factor Behavior in AC Railway System Based on Special Traction Transformers

3-Dimensions. 3-Dimensions. 3D Shapes. Recognise 3-D Shapes and know their properties. 2 Dimensional. 3 Dimensional. Exercise 1

Designer s Guide. A New Class of Multi-Source/Multi-Zone Controller Amplifier

Package: H: TO-252 P: TO-220 S: TO-263. Output Voltage : Blank = Adj 12 = 1.2V 15 = 1.5V 18 = 1.8V 25 = 2.5V 33 = 3.3V 50 = 5.0V 3.3V/3A.

Switches- and Indicators. Switches Unlimited Contact: Phone: * Fax:

InterSCity: Addressing Future Internet Research Challenges for Smart Cities

xxxxxxxxx Mil-HDBK-217F Notice 2 MTBF Prediction Report Issue 1.0 / July 2016 This report has been prepared for:

Using SigLab for Production Line Audio Test

ETSI TS V1.2.1 ( )

Performance Analysis of BLDC Motor for Sinusoidal and Trapezoidal Back-Emf using MATLAB/SIMULINK Environment

Marking Period 3. Marking Period 1. Terminology, Types of Stages 4 Vocal Clarity 24 5 Members Involved in the Production of a 25

OPEN-EASE A Knowledge Processing Service for Robots and Robotics/AI Researchers

PERFORMANCE ANALYSIS OF DIGITAL BEAMFORMING ALGORITHMS

Welcome to Wallace & Gromit s Activity Pack years

UNDERSTANDING SIGMA DELTA MODULATION: The Solved and Unsolved Issues

Enhancing the Performance of Ultra-Tight Integration of GPS/PL/INS: A Federated Filter Approach

Efficient loop-back testing of on-chip ADCs and DACs

Analysis the Performance of Coded WSK-DWDM Transmission System

Increasing Students Engagement in Data Structure Course Using Gamification

Transcription:

Prototyp basd languags Author Tomas Billborn & Mallla Srinivasa Rao

Abstract Whn objct orintd languags ar brought up as subjct most of us think of languags that support data abstraction by providing data tmplats calld classs. This sinc class-basd languags ar mor common and familiar to most programmrs than prototyp-basd ons. It may sm a bit pculiar to talk about objcts without classs, but that is th subjct of th papr. Th papr will giv an ovrviw dscription of how prototyp basd languags function and xamin som of thir advantags and disadvantags.

Contnt Introduction...4 Th objct orintatd hirarchy...5 Prototyp basd languags...5 Normal objcts...5 Prototyps...5 Traits...5 Cration of objcts... 5 Ex-nihilo...5 Cloning...5 Shallow cloning...5 Dp cloning...6 Extnsion... 6 Inhritanc...6 Dlgation-basd inhritanc...6 Embddd--basd inhritanc...6 Sharing achivd by shallow cloning...6 Sharing achivd by dlgation...6 Implicit dlgation...6 Explicit dlgation...6 Class-lik sharing in prototyp basd languags... 6 Dynamic inhritanc...7 Advantags of prototyp basd inhritanc... 7 Th nd for abstraction...7 Th origin of prototyp basd languags...7 Conclusion...8 Rfrncs...9

Introduction Sinc th lat 1980s prototyp basd languags and programming has bn proposd as an altrnativ to th class-basd approach of objct orintation programming. Prototyp basd languags ar mainly charactrizd by th fact thy hav rjctd th notation of classs. Instad ach objct holds its own dscription and th lack of bound to a class allows ach objct is allowd to volv on its own. Th most important ida of th prototyp-basd is that concrt objcts ar only man to modl applications. Prototyps ar not mant to b abstractions lik classs and ar not linkd in any othr way to othr objcts that would dscrib thm as in th class-basd approach.

Th objct orintatd hirarchy Th prototyp basd languags ar a sub-sub branch of th objct orintatd hirarchy. 1 Figur 1: A Hirarchy of Objct Orintd Faturs. Prototyp basd languags In a prototyp basd languag thr ar no distinction btwn class and instanc, thr ar simply objcts. Thr ar thr typs of objcts, normal objcts, prototyps and traits. Although th last two ar not tru objcts. Normal objcts: intndd only to b usd and to carry local stat and should rly on traits for thir mthods [1]. Prototyps: a spcial kind of objct that ar intndd to b bluprints from which normal objcts (and prototyps) ar gnratd via clond. Prototyps act lik classs, but thy ar fully functional objcts [1,2,3]. Traits: abstract dscriptions of objcts. Thy ar similar to classs, but ar not allowd to possss stat. A trait provids a st of mthods that implmnts bhaviour. Traits ar intndd only as th shard parnts of normal objcts: and should not b usd dirctly or clond [1,3,4]. Cration of objcts Thr ar thr primitiv ways to crat objcts in prototyp basd languags: Ex-nihilo: cration of objcts with no parnts. If x-nihilo cration is allowd, thy can com in two forms. As mpty nw objcts, or nw objcts with initial bhaviour [2, 11]. Cloning: nw objcts ar cratd by making copis of objcts that alrady xists. Thr ar two typs of cloning. o Shallow cloning: taks a copy of th stat of th objct and shars th bhaviour with th objct from which it was clond by mans of dlgation [5]. 1 All functions mntiond blow may not xist in all prototyp basd languags, but at last on from ach catgory do.

o Dp cloning: taks a copy of both th stat and th bhaviour of th objct [5]. Extnsion: to crat an objct that shars knowldg with a prototyp, you construct an xtnsion objct, which has a list containing its prototyps, which may b shard by othr objcts, and prsonal bhaviour idiosyncratic to th objct itslf [2]. Inhritanc In prototyp basd languags thr ar four catgoris of inhritanc. Dlgation-basd inhritanc: rusing mthods by sharing thm with othr objcts. This can b don implicitly or xplicitly. Embddd-basd inhritanc: rusing mthods by xtracting thm from othr objcts. This can b don implicitly or xplicitly. Sharing achivd by shallow cloning Whn an objct is clond by using shallow cloning th nwly clond objct rcivs that objcts stat and bhaviour [2]. Sharing achivd by dlgation Th basic ida of dlgation is to forward rqusts that cannot b handld by an objct to th prototyp which it is basd on. As long as an objct and its parnt xist dlgation achivs lif-tim sharing. Thr ar two altrnativs of dlgation, implicit and xplicit [2]. Implicit dlgation: whn an objct cannot answr a mssag, th intrprtr automatically dlgats it to anothr objct; objcts hav a parnt link to indicat to th intrprtr to which objcts mssags should b dlgatd [2]. Explicit dlgation: th dlgation of mssags is don xplicitly for ach mssag to b dlgatd; th dlgating objct nams th objct to which th mssag has to b dlgatd [2]. Class-lik sharing in prototyp basd languags As shown cloning and dlgation achiv diffrnt kinds of usful sharing, but is it th sam kind of sharing found in traditional class-basd objct orintatd languags? Th answr to this is no, sinc rus from prototypical instancs using both cloning and dlgation caus smantic problms. Th problm with cloning is that whn modifying th prototypical instanc, thr is no way to insur that th family of objcts clond from this prototypical instanc will b homognous; objcts clond bfor th modification will not b affctd, thus thy will divrg from th nw concpt implmntd by th updatd prototypical instanc. With dlgation, th problm is sn th othr way around. Whn th prototypical instanc is modifid, all objcts dlgating to it ar affctd by th modification; if th prototypical instanc looss its status of bing prototypical and instad bcoms an xcptional instanc of th concpt, th original concpt is lost.

In both cass, a solution may b to mak prototypical instancs immutabl, but this solution is contrivd in two ways. First, it introducs a distinct kind of objcts in th prototyp-basd modl, which thn looss part of its lganc and simplicity. Scond, by making prototypical instancs immutabl, w loos th capability of normally spaking about ths objcts. W conclud that prototypical instancs ar not th right dvic to implmnt [2]. Dynamic inhritanc Som prototyp basd languags lik SELF also supports dynamic inhritanc, th ability of an objct to chang th cod that it inhrits at run tim [6]. Advantags of prototyp basd inhritanc In prototyp-basd inhritanc thr ar two big advantags, simplicity and corrctnss. Simpl sinc th concpt of class is liminatd and rathr thn having two inhritanc rlations as in class-basd languags thr is just on. This rducs th cognitiv load of th programmr. Its mor concrt sinc programming on modifis th objcts dirctly and not class indirctly to achiv th ffct on an objct [7]. Th nd for abstraction Dspit all th advantags of th prototyp basd languags thy still ar facd with two major problms. On is rlatd to th lack of strong idntity for prototyps and th othr on to organisation of programs. Th programming modl of prototyp basd languags ar simplr and mor flxibl, but whn facd with largr programs th lack of satisfactory way to dfin concpts maks it slf visibl. Our othr problm is rlatd to how svral prototyp basd systm try to tackl th problm of organisation of programs with class lik constructs. Som of ths hav bn intgratd to th systm krnl and ar not accssibl to th programmr and thrfor not much hlpful to xplicitly dfin abstractions [8]. Th origin of prototyp basd languags Th dfinit origin of prototyp basd languags is hard to dtrmin, but th crators may bn inspird by Wittgnstin s criticism of classification [3,9] or by th prototyp thory [10] by Elanor Rosch from th mid svntis. Eithr way th paprs rfrrd to abov might not hold th answr to what xactly that is, but will prsnt th radr with som intrsting philosophical background on prototyps on lss tchnical grounds.

Conclusion W hav lookd at a gnral dscription of th prototyp basd languags and com to th conclusion that: Th main charactristic of prototyp basd languags is th fact that thy ar classlss. Thr ar svral diffrnt prototypd languags and all do not posss all th sam functionality, but thy do posss at last on of th diffrnt typs of dscriptions of typ of objcts, cration of objcts, inhritanc that has bn shown. It has also bn shown that prototyp basd languags possss svral advantags ovr class-basd ons. Prototyp basd languags ar concptually asir to undrstand thn classbasd languags, sinc thr is just on typ of objct. Thr is only on kind of rlationship, inhritanc from parnt, not as in for xampl class-basd languags instanc and subclass. Prototyp basd languags ar mor concrt sinc copying and modification of objcts ar mor dirct. Prototyp basd languags ar mor flxibl sinc it can hold bhaviour or, through copy act as a sourc for nw objcts. With th advantags also coms som disadvantags. Prototyps can b inadvrtntly modifid which might affct futur clons. This can lad to subtl bugs. This is rfrrd to as th prototyp corruption problm. Th construction of crtain objcts rquirs a crtain construction plan to b xcutd. In Class Basd Languags, it is possibl to formalis this plan as a class constructor. In Prototyp basd languags thr is no such thing: objcts ar cratd by cloning othr objcts and it rquirs a lot of disciplin from programmrs to mak sur crtain procdurs ar followd. Prototyp basd languags suffr from a r-ntrancy problm. A problm with naiv prototyp-basd thinking is that, whn cloning objcts not only thir stat but also thir bhaviour gts copid. This mans that an objct with 10 mthods will giv ris to 50 mthods whn clond 5 tims, or at last 50 pointrs all pointing to th sam mthods. Th problm can b circumvntd using th traits tchniqu, but this is somtims problmatic as th traits tchniqu havily intrfrs with th inhritanc hirarchy.

Rfrncs 1. [Cardlli96] Luca Cardlli, Objct-basd vs. Class-basd Languags http://rsarch.microsoft.com/usrs/luca/slids/1996-05%20class-basd%20vs% 20Objct-basd%20Languags%20(PLDI%20Tutorial).pdf 2. [DMC92] Christoph Dny, Jacqus Malnfant and Pirr Coint, Prototyp- Basd Languags: From a Nw Taxonomy to Constructiv Proposals and Thir Validation http://portal.acm.org/citation.cfm?id=141954&coll=guide&dl=guide&cfid=441597 98&CFTOKEN=15280960&rt=1#Fulltxt 3. [Psonn01] Juha Pttri Psonn, Psychological criticism of th prototyp-basd objct-orintatd languags http://www.hlsinki.fi/~jppson/paprs/kandi.html 4. [Mrizzi05] Nicholas Mrizzi, Objct Orintd Classs, Objcts, Inhritanc and Typing http://www.cas.mcmastr.ca/~cartt/cas706/2005/ooprsntation.pdf 5. [DM02] Jssi Ddckr and Wolfgang D Mutr, Using th Prototyp-basd Programming Paradigm for Structuring Mobil Applications http://prog.vub.ac.b/publications/2002/vub-prog-tr-02-28.pdf 6. [BAB04] Andi Bjlri, Jonathan Aldrich, and Kvin Birhoff, A typ chckd prototyp-basd modl with linarity http://rports-archiv.adm.cs.cmu.du/anon/isri2004/cmu-isri-04-142.pdf 7. [Smith95] Waltr R. Smith, Using a Prototyp-basd Languag for Usr Intrfac: Th Nwton Projct s Exprinc http://wsmith.bst.vwh.nt/oopsla95.pdf 8. [Bardou00] Danil Bardou, Inhritanc Hirarchy Automatic (R)organization and Prototyp-Basd Languags ftp://ftp.inrialps.fr/pub/romans/publications/bardou00a.pdf 9. [Arts01] Kris Arts, Visto: A Dclarativ Mthodology for Graphical Usr Intrfacs, basd on Haskll http://www.cs.kuluvn.ac.b/publicatis/doctoratn/cw/cw2001_1.pdf 10. [Psonn02] Juha Pttri Psonn, Concpts and Objct-Orintd Knowldg Rprsntation http://thsis.hlsinki.fi/julkaisut/hum/psyko/pg/psonn/concpts.pdf 11. [Wuyts05] Rol Wuyts, Programming Languags http://www.ulb.ac.b/di/rwuyts/info020_2004/09-prototypsandslf.pdf