|
1
|
- Keith Alcock
- TCS DevSIG
- 3 February 2004
|
|
2
|
- Introduction: What is Smalltalk?
- Hands On: Dolphin Smalltalk
- Conclusion: Resources
|
|
3
|
- Language
- Characteristics
- Implementation
|
|
4
|
- Syntax
- object message
- noun verb (you scram)
- noun verb: object (you
read: aBook)
- noun verb: object preposition: object (you give: theBook to: me)
- Incompatibilities
- ↑ for ^, ← for :=, {} for ##() in Squeak
- namespaces in VW
- Library
- 10,000s of methods, 1,000s of classes
- GUI development
- Portable across OSes, not Smalltalks
- Model View Controller (MVC) or Presenter (MVP) architecture
- Standard
- ANSI 1998
- Errors and omissions
- Backward compatibility issues
|
|
5
|
- Object oriented
- Single inheritance
- Zero or more protocols (interfaces)
- Garbage collected
- Dynamically typed
- Reflective (supports reflection)
- Image based
- Virtual machine hosted
- Integrated (with development environment)
- Optimized for development speed over processing speed
|
|
6
|
|
|
7
|
- Squeak
- GNU Smalltalk
- #Smalltalk
- Pocket Smalltalk
- Little Smalltalk
- S# for AOS
|
|
8
|
- Language
- Exercises
- Environment
- Applications
|
|
9
|
- Syntax
- Literal objects
- integer: 3
- character: $a
- string: ‘string’
- symbol: #
- array: #(1 2 3)
- comment: “comment”
- block: [ ]
- Messages
- Statements
- Terminated with period.
- ^
- :=
- cascades
- Blocks
- niladic: [ ] value
- monadic: [ ] value:
- dyadic: [ ] value:value:
- Control flow
- ifTrue: [ ].
- ifFalse: [ ].
- ifTrue: [ ] ifFalse: [ ].
- [ ] whileTrue.
- [ ] whileTrue: [ ].
- [ ] whileFalse.
- [ ] whileFalse: [ ].
- do: [ ].
- [ ] repeat.
- timesRepeat: [ ].
- no switch
- Exceptions
- Order of evaluation
|
|
10
|
- Semantics
- Methods are public
- Can be flagged as private, but not enforced
- Variables are protected
- Require accessors for non-subclass access
- Uninitialized variables are set to nil
- Methods return a single value using ^ or implicitly return self
- Blocks return the value of the last expression
- Case follows conventions
- Uppercase first letter for classes
- Lowercase first letter for variables and methods
- Camelcase thereafter
|
|
11
|
- Variables
- Intrinsic
- Block
- Method
- Arguments
- Instance
- Class
- Class instance
- Pool
- (Namespace)
- Global
|
|
12
|
- Structure
- Statement
- Method
- Category
- Protocol
- Class
- Package (Parcel)
- (Namespace)
- Application
|
|
13
|
- Control flow
- before:do:
- after:do:
- beside:do
- // C# code (imagine dot product of vectors)
- string[] books=new string[]{
- "Book1","Book2","Book3"
- };
- string[] authors=new string[]{
- "Author1","Author2","Author3"
- };
- for (int i=0;i<books.Length;i++)
- Console.WriteLine("Book: {0} Author: {1}",
- books[i],authors[i]);
|
|
14
|
- FizzBuzz
- Free code
- Method
- Class
- Application
|
|
15
|
- Windows
- Workspace
- Transcript
- Debugger
- Test-first development
- Allows code changes during execution
- Inspector
|
|
16
|
- Browsers
- Classes
- Packages
- Protocols
- Resources
- Pool Dictionaries
- Source
|
|
17
|
- Files
- *.img
- *.sml
- *.chg
- *.pac, *.pak
- *.st
- *.cls
|
|
18
|
- Tools
- Prepackaged
- SUnit
- Refactoring support
- ActiveX/COM
- ADO and ODBC
- Contributed
- DSDN (documentation and newsgroup archives)
- Chunk browser
- Profiler
|
|
19
|
- Spelling
- MutsunParser (detector)
- SpellChecker (corrector)
- GUI
- ReadSmartOptions (example GUI)
- Development
- MyPackageBrowser
- Export to RTF or package script, metrics, diagrams
- MyClassBrowser
- Export or view as RTF, metrics, edit definition, browse variables
- Games
|
|
20
|
- Books
- Web sites
- Newsgroups
|
|
21
|
- The Art and Science of Smalltalk, Simon Lewis
- Smalltalk Best Practice Patterns, Kent Beck
- Smalltalk with Style, Suzanne Skublics et al.
- The Design Patterns Smalltalk Companion, Sherman R. Alpert, et al.
- The Dolphin Smalltalk Companion, Ted Bracht
- Squeak: Object-Oriented Design with Multimedia Applications, Murk
Guzdial
|
|
22
|
- Smalltalk, Objects, and Design, Chamond Liu
- Smalltalk 80: The Language, Adele Goldberg
- Object-Oriented Implementation of Numerical Methods: An Introduction
with Java & Smalltalk, Didier Besset
- Kent Beck’s Guide to Better Smalltalk: A Sorted Collection, Kent
Beck
- Squeak: A Quick Trip to ObjectLand, Gene Korienek
|
|
23
|
- Why Smalltalk?
- Smalltalk Industry Council
- Smalltalk.org
- Vendors’ web sites
- My web site (for slides and code)
- http://www.keithalcock.com
|
|
24
|
- General
- comp.lang.smalltalk
- comp.lang.smalltalk.dolphin
- comp.lang.smalltalk.advocacy
- news.totallyobjects.com
- comp.lang.smalltalk.mt
- comp.lang.smalltalk.objectstudio
- news.software.ibm.com
|