DOC PREVIEW
UT Arlington CSE 3302 - CSE 3302 Lecture Notes

This preview shows page 1-2-23-24 out of 24 pages.

Save
View full document
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
View full document
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience
Premium Document
Do you want full access? Go Premium and unlock all 24 pages.
Access to all documents
Download any document
Ad free experience

Unformatted text preview:

CSE 3302 Programming LanguagesWhy Study SmalltalkKey FeaturesHistoryHistory (cont.)Smalltalk TodayResourcesRequired ReadingSmalltalk, Squeak videoThe language is together with its interactive runtime systemSmalltalk RuntimeSqueak DemoDemo: Race CarDemo: Quinto GameSlide 15Slide 16Slide 17Slide 18Slide 19Slide 20Slide 21Slide 22Slide 23Demo: MineSweeperCSE 3302 Programming LanguagesChengkai LiSpring 2008Object-Oriented ProgrammingLecture 13 – OO Programming, Spring 20081CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 2008Why Study Smalltalk•Purest OO language, encourage OO programming•Can inspect and change objects and the runtime system itself at run time•Pioneered in many things–Graphical user interface (Window, Menu, Mouse)–Personal workstation–Push OO into success•I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. -- Alan Kay•Has an active community•Could have deserved more popularityLecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 20082Key Features•Very simple syntax•Everything is object3, true, nilClass is objectno control: if, loop are objects•Dynamically typed:–Variable has no type.–The class hierarchy is the type system.•The language is together with its interactive runtime system–Runtime written in the language itself–Can change the system on-the-fly–Debug system state (image), object, class hierarchy•All data is private (protected), all methods are public.•No manual memory management and pointersLecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 20083History•1967: Inspired by Simula67, the first OO language•1971: Started by Dynabook project (Alan Kay)–Hardware: GUI, pointing device, external storage, etc.•Later led to Alto (“laptop”)–Software: for Children •Became Smalltalk–EducationIs Dynabook realized? Kay doesn’t think so:–Squeak–One Laptop Per Child project (Nicholas Negroponte, Alan Kay, …)http://www.xogiving.org/Lecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 20084History (cont.)•1973: Xerox Alto Computer–First Smalltalk environment–The ALTO Computer 1974 - Video•http://www.maniacworld.com/alto-computer-video.html•1972: Smalltalk-72•1976: Smalltalk-76•1980: Smalltalk-80•Major contributors of Smalltalk:Alan Kay (2003 Turing Award), Adele Goldberg, Daniel Ingalls, et. Al.Lecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 20085Smalltalk Today•Squeak–Seaside: a dynamic web application development framework–Croquet: an open source platform for collaborative 3D multi-user online applications. –Sophie: a digital media assembly tool to create multimedia documents.–Scratch: a toolkit for children to write games, animated stories.•Cincom VisualWorks, IBM VisualAge, GNU Smalltalk, Dolphin, ….Lecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 20086ResourcesSqueak:•Download at http://www.squeak.org/•Quick Tutorial:A Development Example for Squeak 3.9http://squeak.preeminent.org/tut2007/html/•A Free Book:Squeak by Examplehttp://www.iam.unibe.ch/~scg/SBE/Lecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 20087Required ReadingReadings:•Smalltalk by Example, Chapter 1-6(Chapter 7-9 are also recommended, especially sections related to Array)•Section "10.6 Smalltalk" in the textook.Lecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 20088Smalltalk, Squeak video•http://www.youtube.com/watch?v=y_3l08tI5wQ•http://video.google.com/videoplay?docid=‐2950949730059754521•http://video.google.com/videoplay?docid=‐9055536763288165825Lecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 20089The language is together with its interactive runtime systemLecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 200810Smalltalk Runtime•Runtime written in the language itself•Can change the system on-the-fly•Debug system state (image), object, class hierarchyLecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 200811Squeak Demo•The files (.exe .changes, .img, .sources)•Menu and Mouse (red-button (usually left button), yellow-button (usually right button), blue-button(Alt+red, “morphic halo”) )•Save changes into .img and .sources•Transcript: system console, log•Workspace: Run code snippet, text documents, …•do it, print it, inspect it, explore it•System Browser (Class, Object, Instance variable, Method)•Hierarchy Browser•Method FinderLecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 200812Demo: Race Carhttp://www.youtube.com/watch?v=y_3l08tI5wQLecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 200813Demo: Quinto GameSqueak by Example, Chapter 2Lecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 200814Demo: Quinto Game1. Create new class category: SBE-Quinto2. Define new class: SBECellObject subclass: #NameOfSubclassinstanceVariableNames: ''classVariableNames: ''poolDictionaries: ''category: ‘SBE-Quinto‘SimpleSwitchMorph subclass: #SBECellinstanceVariableNames: 'mouseAction'classVariableNames: ''poolDictionaries: ''category: ‘SBE-Quinto'Lecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 200815Message: class compiledDemo: Quinto Game3. Add methods: initialize initializesuper initialize.self label: ''.self borderWidth: 2.bounds := 0@0 corner: [email protected] := Color paleYellow.onColor := Color paleBlue darker.self useSquareCorners.self turnOffLecture 13 – OO Programming, Spring 2008CSE3302 Programming Languages, UT-Arlington ©Chengkai Li, 200816newCell := SBECell new.Message initialize will be automatically sent to the newly created object when the class has an initialize method.newCell initialize.Demo: Quinto Game4. Inspect an objectSBECell new (inspect it)self openInWorld (do it)5. Add new class: SBEGameBorderedMorph subclass: #SBEGameinstanceVariableNames: ‘cells'classVariableNames: ''poolDictionaries: ''category:


View Full Document

UT Arlington CSE 3302 - CSE 3302 Lecture Notes

Documents in this Course
Smalltalk

Smalltalk

11 pages

Syntax

Syntax

5 pages

Syntax

Syntax

5 pages

JAVA

JAVA

57 pages

Semantics

Semantics

41 pages

Control

Control

74 pages

Load more
Download CSE 3302 Lecture Notes
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view CSE 3302 Lecture Notes and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view CSE 3302 Lecture Notes 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?