• Like

Loading…

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

8 - OOP - Smalltalk Model

  • 696 views
Uploaded on

 

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
    Be the first to like this
No Downloads

Views

Total Views
696
On Slideshare
0
From Embeds
0
Number of Embeds
0

Actions

Shares
Downloads
4
Comments
0
Likes
0

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. A Little Journey in the Smalltalk Model
  • 2.
    • A pure and minimal object model
    • Less is more!
  • 3.
    • No constructors
    • No types declaration
    • No interfaces
    • No packages/private/protected
    • No parametrized types
    • No boxing/unboxing
    • Still powerful
  • 4.
    • 1600 simultaneous users
    • 1.9 billions objects
    • 10 000 updates/day
  • 5.  
  • 6.
    • Objects are instances of Classes
  • 7.
    • Objects are instances of Classes
    • (10@200)
  • 8.
    • Objects are instances of Classes
    • (10@200) class
  • 9.
    • Objects are instances of Classes
    • (10@200) class
    • Point
  • 10.
    • Classes are objects too
  • 11.
    • Classes are objects too
      • Point selectors
  • 12.
    • Classes are objects too
      • Point selectors
          • > an IdentitySet(#eightNeighbors #+ #isZero #sortsBefore: #degrees #printOn: #sideOf: #fourNeighbors #hash #roundUpTo: #min: #min:max: #max #adaptToCollection:andSend: #quadrantOf: #crossProduct: #= #nearestPointOnLineFrom:to: #bitShiftPoint: #* #guarded #insideTriangle:with:with: #grid: #truncateTo: #y #setR:degrees: #normal #directionToLineFrom:to: #truncated #nearestPointAlongLineFrom:to: #theta #scaleTo: #encodePostscriptOn: #> #asPoint #extent: #r #roundTo: #max: #interpolateTo:at: #triangleArea:with: #angleWith: #dotProduct: #isSelfEvaluating #'<=' #to:intersects:to: #'//' #isInsideCircle:with:with: #< #scaleFrom:to: #corner: #to:sideOf: #x #'>=' #roundDownTo: #onLineFrom:to:within: #transposed #ceiling #angle #basicType #translateBy: #asFloatPoint #'apos; #adaptToNumber:andSend: #abs #negated #octantOf: #asIntegerPoint #flipBy:centerAt: #scaleBy: #floor #onLineFrom:to: #isPoint #reflectedAbout: #/ #dist: #asNonFractionalPoint #bearingToPoint: #reciprocal #rotateBy:centerAt: #rotateBy:about: #rounded #setX:setY: #squaredDistanceTo: #normalized #veryDeepCopyWith: #- #storeOn: #rect: #deepCopy #isIntegerPoint #min #adhereTo: #adaptToString:andSend:)
  • 13.
    • Classes are objects too
      • Point instVarNames
  • 14.
    • Classes are objects too
      • Point instVarNames
        • >#('x' 'y')
  • 15.
    • Methods are public
  • 16.
    • Instance variables are protected
  • 17.
    • Single Inheritance
  • 18.
    • Single Inheritance
        • Object subclass: # Point
        • instanceVariableNames: 'x y'
        • classVariableNames: ''
        • poolDictionaries: ''
        • category: 'Graphics-Primitives'
  • 19. 1 2
  • 20.
    • Classes are objects too
  • 21.
    • Classes are objects too
    • Point class
  • 22.
    • Classes are objects too
    • Point class
      • >Point class
  • 23.
    • Classes are objects too
    • Point class
      • >Point class
      • “Point class” is an anonymous class with only one instance: Point
  • 24. Class Parallel Inheritance
  • 25. Lookup and Class Methods 1 2 1 2 Workstation withName: ‘BigMac’ aWorkstation name
  • 26. About the Buttons
  • 27. Summary
    • - Everything is an object
    • - One single model
    • - Single inheritance
    • - Public methods
    • - Protected attributes
    • - Classes are simply objects too
    • - Class is instance of another class
    • - One unique method lookup
    • look in the class of the receiver