1 / 27

A Little Journey in the Smalltalk Model

A Little Journey in the Smalltalk Model. A pure and minimal object model Less is more!. No constructors No types declaration No interfaces No packages/private/protected No parametrized types No boxing/unboxing Still powerful. 1600 simultaneous users 1.9 billions objects

plato
Télécharger la présentation

A Little Journey in the Smalltalk Model

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation 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. Objects are instances of Classes

  6. Objects are instances of Classes • (10@200)

  7. Objects are instances of Classes • (10@200) class

  8. Objects are instances of Classes • (10@200) class • Point

  9. Classes are objects too

  10. Classes are objects too • Point selectors

  11. 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 #'\\' #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:)

  12. Classes are objects too • Point instVarNames

  13. Classes are objects too • Point instVarNames • >#('x' 'y')

  14. Methods are public

  15. Instance variables are protected

  16. Single Inheritance

  17. Single Inheritance • Object subclass: #Point • instanceVariableNames: 'x y' • classVariableNames: '' • poolDictionaries: '' • category: 'Graphics-Primitives'

  18. 2 1

  19. Classes are objects too

  20. Classes are objects too • Point class

  21. Classes are objects too • Point class • >Point class

  22. Classes are objects too • Point class • >Point class • “Point class” is an anonymous class with only one instance: Point

  23. Class Parallel Inheritance

  24. Lookup and Class Methods 2 2 1 1 aWorkstation name Workstation withName: ‘BigMac’

  25. About the Buttons

  26. 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

More Related