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.

Like this presentation? Why not share!

Like this? Share it with your network

Share

Integration of Cincom Smalltalk Systems

on

  • 980 views

Integration of Cincom Smalltalk Systems. Georg Heeg, ESUG 2006, Prague

Integration of Cincom Smalltalk Systems. Georg Heeg, ESUG 2006, Prague

Statistics

Views

Total Views
980
Views on SlideShare
980
Embed Views
0

Actions

Likes
0
Downloads
3
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Integration of Cincom Smalltalk Systems Presentation Transcript

  • 1. Georg Heeg eK Georg Heeg eK Baroper Str. 337 Mühlenstr. 19 44227 Dortmund 06366 Köthen Germany Germany Tel: +49-231-97599-0 Tel: +49-3496-214 328 Fax: +49-231-97599-20 Fax: +49-3496-214 712 Georg Heeg AG Seestraße 135 8027 Zürich Switzerland Email: georg@heeg.de Tel: +41(848) 43 34 24 http://www.heeg.de
  • 2. Ge or g H e e g Pr a gu e , Se pt e m be r 7 t h , 2 0 0 6 2
  • 3. Abou t Ge or g H e e g e K Founded 1987, headquart er in Dort m und, since 1996 in Zurich, since 1999 in Koet hen/ Anhalt Consult ing- and t raining com pany in Sm allt alk Hot line support , m aint enance, bug- fixes for Obj ect St udio, VisualWorks and Visual Sm allt alk VM- laborat ory for VisualWorks and Obj ect St udio Port ing service of old VisualWorks applicat ions t o 5i/ 7 Technology- part ner of Corporate Mission: Make Sophisticated Projects a Success for the Customer! 3
  • 4. Som e Ba ck gr ou n d 1994/ 96 Cincom bought Obj ect St udio 1999 Cincom bought VisualWorks Obj ect St udio cust om ers keep asking for VisualWorks feat ures Obj ect St udio 8 int egrat es VisualWorks and Obj ect St udio 4
  • 5. Obj e ct St u dio a n d Visu a lW or k s Bot h Obj ect St udio and VisualWorks are Smalltalk systems. Bot h are owned by t he sam e com pany Cincom VisualWorks like Squeak goes back t o t he original Sm allt alk- 76/- 78/- 80 developm ent s at Xerox PARC. Originally called Smalltalk- 80, ObjectWorks later Obj ect St udio was developed as Enterprise Object- Oriented Development Environment Originally called Enfin. 5
  • 6. Ke y Fe a t u r e s Enfin/ Obj ect St udio Ease of Use Ent erprise I nt egrat ion Sm allt alk- 80/ Obj ect Works/ VisualWorks Execut ion speed Sophist icat ed m et a- m odelling feat ures Cust om ers want bot h Speed: always Ease of use: t o get st art ed Ent erprise int egrat ion: m ost ly m et a- m odeling: seldom but if t hey need it , t hey out perform having it . 6
  • 7. Fr om For be s.COM A press conference is called. The m edia is alert ed. The t op execut ives gat her for m uch backslapping and m ult isyllabic descript ions of t he synergist ic opport unit ies abounding in t his, a fresh new part nership. There's a cham pagne t oast and t hen t he m ost ext raordinary t hing happens ...not hing! Not hing at all. ht t p: / / www.forbes.com / 2002/ 07/ 01/ 0701alliances.ht m l 7
  • 8. Syn e r gy doe sn t W or k VisualWorks VM for Obj ect St udio HPOS Was st art ed and was not com plet ed I deas t o int egrat e Obj ect St udio int o .NET didn t m ake it 8
  • 9. Th e or y: Sm a llt a lk is D iffe r e n t I n Sm allt alk program m ing is m odeling. Thus every t heory can be m odeled well. Thus every com put er t echnology can be m odeled well Thus every ot her Sm allt alk syst em can be m odeled well. 9
  • 10. Obj e ct St u dio 8 Model Obj ect St udio by VisualWorks in Sm allt alk Use Met a- Modeling Use all reflect ion capabilit ies Com piler Debugger Nam espaces 10
  • 11. Th e Goa l Bot h Obj ect St udio and VisualWorks live in t he sam e im age t he sam e t im e Bot h Environm ent s share t he sam e Sm allt alk kernel and base classes t o provide ident ical funct ionalit y Mixing and m at ching is seam lessly possible Bot h Obj ect St udio and VisualWorks applicat ion Sm allt alk code works unchanged There will always be except ions t o t his rule 11
  • 12. Th e Te a m Suzanne Fort m an ( Program Direct or, Cincom Sm allt alk) Andreas Hiltner (ObjectStudio 8 Lead Engineer) Mark Grinnell ( Obj ect St udio Lead Engineer) Eduard Maydanik ( GUI Engineer) Kim Thom as ( Test ing, Packaging, Support ) Eliot Miranda ( VisualWorks Lead Engineer) Alan Knight ( St ore Consult ant ) Jörg Belger ( VisualWorks Wrapper) Jam es Robert son ( Product Manager) Georg Heeg (Idea) Helge Nowak (Sales Engineer) Monika Laurent (Marketing) 12
  • 13. Th e Fir st St e p Vocal chords surgery in June 2004 No perm ission t o speak for a week 13
  • 14. 14
  • 15. En d of Fir st St e p Sm allt alk works UI does not work Prim it ives don t work 15
  • 16. Th e Se con d St e p: Pr im it ive s Jörg Belger st art s working at Georg Heeg eK Köt hen Oct ober 1, 2004 Coaut hor of t he original Ce VM as int ern ( 100 days) Coaut hor of com put er gam es Background in C+ + Obj ect St udio MFC DLL funct ions are im plem ent ed One per one at a t im e 16
  • 17. Th e Fir st W in dow Ope n s User Conference in Frankfurt Decem ber 2004 First cust om ers see it and are im pressed 17
  • 18. Se con d St e p: Pr oof of Con ce pt One prim it ive at a t im e One day per prim it ive But There are alone 450 MFC prim it ives Second st ep is st opped in January 2005 18
  • 19. Th ir d St e p: D o it Com ple t e ly Take t he ent ire Obj ect St udio C/ C+ + - Code Make it a VisualWorks callable DLL St art ed in February 2005 19
  • 20. Ju n e 2 0 0 5 Alpha1 Version m ade First t im e com plet e But not t est ed or bug- free 20
  • 21. For t h st e p: Ch e ck for Com pa t ibilit y Run all com ponent s of t he syst em I f t hey work different ly Add com pat ibilit y Decide for incom pat ibilit y seldom and easy to understand E.g.: BOSS instead of BinaryObj ect St ream s Run real Cust om er Applicat ions Det ails: see lat er 21
  • 22. Se pt e m be r 2 0 0 6 Ready for Bet a1 at t he end of t he m ont h 22
  • 23. Ar ch it e ct u r e ove r vie w ObjectStudio Code VisualWorks Code ObjectStudio Smalltalk compatibility layer ObjectStudio DLL Base Classes Virtual Machine 23
  • 24. I m ple m e n t a t ion St r a t e gy KI SS Keep m odificat ions of Obj ect St udio source code t o a m inim um I n Sm allt alk and C/ C+ + Do not m odify VisualWorks VM unnecessarily Fix bugs Addit ional feat ures in VW 7.4.1/ 7.5 Use LoadLibraryEx() instead of LoadLibrary() Event handling in the image 24
  • 25. Ge n e r a l Con ce pt s Model Obj ect St udio by VisualWorks Sm allt alk Preserve synt ax and sem ant ics Obj ect St udioCom piler Em bed in a Nam eSpace Share code Collect ions Magnit ude Sem aphore Boolean Undefined Obj ect 25
  • 26. Visu a lW or k s N a m e spa ce s Goal ( I n- ) visibilit y of global nam es Successor t o GlobalDict ionary PoolDict ionary ClassPools 26
  • 27. Syst e m , t h e Globa lD ict ion a r y I n Classic Obj ect St udio all global nam es live in t he Globaldict ionary called Syst em I n Obj ect St udio 8 Classes live in Nam espace Obj e ct St udio Globals live in Nam espace Obj e ct St udio.Globa ls Non I dent ifier ent ries are St ored in an I dent it yDict ionary 27
  • 28. PoolD ict ion a r ie s In Classic ObjectStudio PoolDictionaries are globals which are IdentityDictionaries OLEConstants := IdentyDictionary new. OLEConstants at: # ADVF_DATAONSTOP put: 64. In ObjectStudio 8 Extra declaration is needed (manually) ObjectStudio.Globals defineNameSpace: #OLEConstants Entries in these Dictionaries become SharedVariables with initializers (automatically) ObjectStudio.Globals.OLEConstants defineSharedVariable: #ADVF_DATAONSTOP private: false constant: false category: 'As yet unclassified' initializer: '64' 28
  • 29. Sh a r e d Cla sse s Act ionSequence, Array, Associat ion, Bag, Behavior, BlockClosure, Boolean, Byt eArray, Charact er, Class, Collect ion, Com piledBlock, Com piledMet hod, Com piler, Dat e, Dict ionary, EncodedSt ream , False, Fract ion, I dent it yDict ionary, I dent it ySet , I nt eger, I nt ernalSt ream , Magnit ude, Met aclass, Met hodCont ext , Num ber, OrderedCollect ion, PeekableSt ream , Point , Posit ionableSt ream , Random , ReadSt ream , ReadWrit eSt ream , Rect angle, Sem aphore, Set , Sm allI nt eger, Sort edCollect ion, St ream , St ring, Sym bol, Tim e, Tim est am p, True, UndefinedObj ect , UserPrim it iveMet hod, WeakDict ionary, Writ eSt ream , Except ion, Error, MessageNot Underst ood, Not ificat ion, St ream Error, Posit ionOut OfBoundsError, I ncom plet eNext Count Error, EndOfSt ream Not ificat ion, Socket Accessor, Socket Address 29
  • 30. Spe cia l Re n a m in g Obj ect St udio defineSharedVariable: # Float privat e: false const ant : t rue cat egory: 'Obj ect St udio Com pat ibilit y 2' init ializer: Core.Double' 30
  • 31. Sou r ce D iffe r e n ce s Obj ect St udio cls files One class per file Wit h class definit ion: prim ary files Class ext ension: secondary file Different chunk file form at Met hod synt ax differences Sem ant ic differences 31
  • 32. Pa r sin g Obj e ct St u dio Sou r ce Code Obj ect St udioCom piler Calls Obj ect St udioParser Obj ect St udioParser Accept s Obj ect St udio Synt ax Creat es Obj ect St udio Synt ax com pliant Synt ax t ree Specifying t o use Obj ect St udio Synt ax classCom pilerClass com pilerClass Aut om at ic source t ransform at ion of m et hods of VisualWorks classes in cls files 32
  • 33. Syn t a x diffe r e n ce s: Ar r a ys a n d con d f: n ^ { { [ n < = 1] [ 1] } { [ t rue] [ ( self f: n - 1) * n] } } cond f: n ^n < 1 ifTrue: [ 1] ifFalse: [ t rue ifTrue: [ ( self f: n - 1) * n] ifFalse: [ Obj ect St udio.Message newValue: 'No condit ion sat isfied'] ] 33
  • 34. Syn t a x diffe r e n ce s: pa r a m e t e r s in c: n n isNil ifTrue: [ n : = 0] . ^n + 1 in c: _ _ n | n | n : = __n. n isNil ifTrue: [ n : = 0] . ^n + 1 34
  • 35. Som e Se m a n t ic D iffe r e n ce s Visu a lW or k s Obj e ct St udio 1 = 0 ifTrue: [ 1] nil False [ : n | ] value: 1 1 nil Array new add: 1 < Error> # ( 1) ( Array new: 1) 7 # ( 7) at : 1 put : 7 35
  • 36. M odifyin g Obj e ct St u dio Pa r se Tr e e Program NodeEnum erat or subclass OSt udioTreeTransform er m odifies parse t ree < osprim > Blocks in lit eral arrays Assignm ent s t o argum ent s Enabling inner ret urns Condit ion result s Subst it ut ions All t his allows for VisualWorks Code generat ion 36
  • 37. M e ssa ge s w it h diffe r e n t Se m a n t ics Kernel.OSt udioTreeTransform er defineSharedVariable: # Subst it ut ions privat e: false const ant : false cat egory: 'const ant s' init ializer: '( Dict ionary new) at : # basicAt : put : put : # os_basicAt : put ; ; yourself 37
  • 38. Su bst it u t e d Se le ct or s , os_comma: asText os_asText methods os_methods subclass:instanceV os_subclass:instanceV // quo: asTime os_asTime nameOfDay: os_nameOfDay: ariableNames:class ariableNames:classVari < os_LessThan: asTimestamp os_asTimestamp new os_new VariableNames:poo ableNames:poolDiction <= os_LessEqualThan: asValue os_asValue new: os_new: lDictionaries:catego aries:category: ry: = os_Equal: at: os_at: nextString os_nextString > os_GreaterThan: at:put: os_at:put: origin:corner: os_origin:corner: subclasses os_subclasses >= os_GreaterEqualThan: basicAt:put: os_basicAt:put: origin:extent: os_origin:extent: subtractTime: os_subtractTime: add: os_add: between:and: os_between:and: perform: os_perform: to:by:do: os_to:by:do: add:after: os_add:after: changeSizeTo: os_changeSizeTo: perform:with: os_perform:with: to:do: os_to:do: add:before: os_add:before: coerce: os_coerce: perform:with:with: os_perform:with:with: totalSeconds os_totalSeconds add:beforeIndex: os_add:beforeIndex: collect: os_collect: perform:with:with:with: os_perform:with:with:with: trimBlanks os_trimBlanks add:withOccurrences: os_add:withOccurrences: copyFrom:to: os_copyFrom:to: perform:withArguments: os_perform:withArguments: value os_value addAll: os_addAll: copyReplaceFrom:to:with: os_copyReplaceFrom:to:with: printOn: os_printOn: wait os_wait addAllFirst: os_addAllFirst: copyWithout: os_copyWithout: printOn:base: os_printOn:base: whileFalse os_whileFalse addAllLast: os_addAllLast: dependents os_dependents printString os_printString whileFalse: os_whileFalse: addDependent: os_addDependent: detect: os_detect: readFrom: os_readFrom: whileTrue os_whileTrue addFirst: os_addFirst: fileName os_fileName remove: os_remove: whileTrue: os_whileTrue: addLast: os_addLast: first os_first remove:ifAbsent: os_remove:ifAbsent: with:do: os_with:do: addTime: os_addTime: firstDayOfMonth os_firstDayOfMonth removeAll: os_removeAll: withAllSubclasses os_withAllSubclasses allInstVarNames os_allInstVarNames flush os_flush removeDependent: os_removeDependent: rem: allSubclasses os_allSubclasses fromDays: os_fromDays: removeKey: os_removeKey: ~= os_NotEqual: asByteArray os_asByteArray ifFalse: os_ifFalse: signal os_signal asFilename os_asFilename ifTrue: os_ifTrue: size os_size asFloat os_asFloat includesKey: os_includesKey: storeOn: os_storeOn: asInteger os_asInteger indexOf: os_indexOf: storeString os_storeString asNumber os_asNumber inheritsFrom: os_inheritsFrom: subclass:instanceVariabl os_subclass:instanceVariabl asSet os_asSet inspect os_inspect eNames:classVariableNa eNames:classVariableNames associationAt: os_associationAt: isAlphaNumeric os_isAlphaNumeric mes:poolDictionaries: :poolDictionaries: associationsDo: os_associationsDo: last os_last asString os_asString leapYear: isLeapYear: 38
  • 39. D iffe r e n t file st r u ct u r e , fir st ve r sion Reader for .t xt and .cls files t o get Obj ect St udio code int o VisualWorks ClassReader Reads t xt files and calls Obj ect St udioChangeScanner Obj ect St udioChangeScanner Reads cls files 39
  • 40. Se con d Ve r sion : Sou r ce Code I n t e gr a t ion Obj ect St udio.Applicat ionDefint ionSt ream Original Classic Obj ect St udio class Reads .t xt files OSt udioChunkSourceFileForm at Lives in VisualWorks SourceFileForm at class hierarchy Reads and writ es .cls files Cont rols t hat .cls files 40
  • 41. Obj e ct St u dio Sm a llt a lk a n d C St rong int erconnect ion bet ween C and Sm allt alk They call each other all the time There are five ways t o call C Direct primitives PrimSpecRec Numbered Primitives <primitive: 123> Named Primitives < osprim: MFC openWindow> < osprim: #myDll myfunc> Module/ENFINModule Programmatic creation of interface methods using osprim ExternalProcedures Programmatic creation of interface methods with C datatypes 41
  • 42. Obj e ct St u dioW r a ppe r D LL Regular VisualWorks DLL Uses _oop as param et er and ret urn t ype Calls Obj ect St udio prim it ives using a sim ulat ed Obj ect St udio st ack 42
  • 43. OPTR a n d _ oop I n Obj ect St udio obj ect point ers OPTR never m ove I n VisualWorks obj ect point er _oop are m oved by t he garbage collect or Obj ect St udio C code relies on not non m oving OPTR Solut ion: Define class OPTR wit h wraps VisualWorks Oops for Obj ect St udio including C+ + reference count ing The real object pointers _oop are stored in a Smalltalk array which is registered in the Visualworks registry t he index t o t his array is st ored in class OPTR as variable Reference count s are st ored in a norm al C array. 43
  • 44. OPTR cla ss ( e x t r a ct ) class __declspec(dllexport) OPTR; typedef OPTR* POPTR; class OPTR { public: static OPTR& cpp_S2O(LONG value); [ ] private: [ ] enum Types { TYPE_NI L = 0, TYPE_NORMALOBJECT, TYPE_NOTNORMALOBJECT, TYPE_UNKNOWN} ; INT m_IndexOrOop; // index in objecttable or not normal object INT m_Type; // type of object static INT s_NumObjects; // number of registered objects static INT s_NextFreeObject; // index of next free object in objecttable static INT s_ObjectTable; // index of objecttable array in visualworks registry 44 static INT* s_LinkTable; // array with linked registry slots
  • 45. D ir e ct Pr im it ive s Look at definit ion Re- im plem ent m ost ly in Sm allt alk using exist ing VisualWorks funct ionalit y I n rare cases replace by osprim 45
  • 46. N u m be r e d Pr im it ive s < Prim it ive: 45> Som e are replaced by VisualWorks Prim it ive E.g. Obj ect > > = = < vwprim it ive: 110> VisualWorks im plem ent at ion For m ost Aut o- generat e calling code 46
  • 47. Au t o- Ge n e r a t e d Pr im it ive disable <primitive: 7> ^ self primitiveFailed. disable < osprimitive: 7> | argumentArray | argumentArray := Core.Array os_new: 0. ^ Obj ect St udioCallI nt erface os_new callPrim: 7 self: self arguments: argumentArray ifFail: [^self primitiveFailed] 47
  • 48. Class Obj e ct St u dioCa llI n t e r fa ce callPrim: primitiveNumber self: oSelf arguments: args ifFail: failBlock self init. ^[self callPrim: primitiveNumber self: oSelf arguments: args] on: PrimitiveFailException do: [:ex| ^failBlock value] callPrim: primitiveNumber self: oSelf arguments: args <C: _oop callPrim(int primitiveNumber, _oop oSelf, _oop args)> _errorCode = 0 ifTrue: [PrimitiveFailException raise]. self externalAccessFailedWith: _errorCode 48
  • 49. Th e C+ + side _oop callPrim(int primitiveNumber, _oop oSelf, _oop args) { AFX_MANAGE_STATE( AfxGet St at icModuleSt at e()); [ ] primReturnCode = CallUserPrim it iveFunc( prim Met hodOPTR); oSelf = PPop( ) .get Obj ect (); [ ] if (primReturnCode == FALSE) UPfail(0); return oSelf; } 49
  • 50. Au t oge n e r a t e d ospr im a ct iva t e Ex clu de Ch ild: fEx clu de < osprim: MFC ActivateForm> ^ self primitiveFailed. a ct iva t e Ex clu de Ch ild: fEx clu de < osprim: MFC ActivateForm> < methodClass: Ext ernalAnnot at edMet hod> | argumentArray | ( argumentArray := Array new: 1) os_at: 1 put: fExclude. ^ Obj ect St udio.Ext ernal.Obj ect St udioCallI nt erface new callOSPrim: thisContext method functionSpecification self: self arguments: argumentArray ifFail: [^self primitiveFailed] 50
  • 51. M a n u a lly cr e a t e d ospr im ( Cla ss Poin t ) translateFromForm: aFormOrFormItem to: anOther "<osprim: TRACK POI NTTRANSLATEFROMFORM> " | args functionSpecification | args := Array new: 2. args at: 1 put: aFormOrFormItem. args at: 2 put: anOther. functionSpecification := OSPrimSpecifier new. functionSpecification module: Root .Obj ect St udio.ENFI NModule versionTag , 'TRACK'. functionSpecification funct ion: 'POI NTTRANSLATEFROMFORM'. functionSpecification numArgs: 2. ^ Root .Obj ect St udio.Obj ect St udioCallI nt erface new callOSPrim: functionSpecification self: self arguments: args ifFail: [^self primitiveFailed] 51
  • 52. OSPr im Spe cifie r Sm allt alk.Kernel defineClass: # OSPrim Specifier superclass: # { Obj ect } indexedType: # none privat e: false inst anceVariableNam es: 'num Args num Tem ps handle funct ion m odule ' classI nst anceVariableNam es: '' im port s: '' cat egory: 'Obj ect St udio Tools 52
  • 53. Ex t e r n a lAn n ot a t e dM e t h od Sm allt alk.Kernel defineClass: # Ext ernalAnnot at edMet hod superclass: # { Kernel.Annot at edMet hod} indexedType: # obj ect s privat e: false inst anceVariableNam es: 'funct ionSpecificat ion ' classI nst anceVariableNam es: '' im port s: '' cat egory: 'Ext ernalAnnot at edMet hod Variable funct ionSpecificat ion st ores inst ances of OSPrim Specifier 53
  • 54. M odu le / En fin M odu le Autogenerate osprim pr iva t e Qu e r yVolu m e N a m e : aSmallInteger < osprim: FI LES PRI VATEQUERYDRI VENAME> ":Section Reference privat eQueryVolum eNam e: aSmallInteger Description: Returns the name of a drive. Assumptions: The drive num ber passed in is a sm all int eger st art ing wit h 1 for drive A: . This funct ion ret urns allways an empty strings on operating systems, which do not support a drive concept. [ ] 54
  • 55. Ex t e r n a l Pr oce du r e s Just work unchanged 55
  • 56. Obj e ct St u dio Un icode I n Obj ect St udio 7 Two inst allat ions Two Virt ual Machines I ncom pat ible I m ages Com pat ible Source Code I n Obj ect St udio 8 One inst allat ion One Virt ual Machine Two set s of DLLs One im age Decision at st art - up 56
  • 57. N a t ive W idge t s Use MFC Callbacks t o VisualWorks 57
  • 58. Ca llin g Sm a llt a lk fr om C PSend is im plem ent ed using OESendMessageMany( ) ASend is im plem ent ed using OESendMessageMany( ) whenIdleSend: aSelector to: aReceiver withArguments: anArray "inserts the asend into the queue " ASendSemaphore critical: [ASendQueue addLast: (Core.MessageSend receiver: aReceiver selector: aSelector 58 arguments: (anArrayOrObject isArray ifTrue: [anArrayOrObj
  • 59. Th e Pr oce ss M ode l VisualWorks process m odel Many Sm allt alk processes are running in different priorit y. Windows event s are handled ( alm ost ) any t im e Shared queues m ove t he event s t o t arget processes This is em plem ent ed in C Obj ect St udio process m odel The caller of all execut ion is t he Windows Event Loop All Message Sends in t he ASendQueue are execut ed when t he Windows Event is em pt y This is im plem ent ed in C+ + 59
  • 60. D e cision of Ju ly 2 0 0 6 Move EventLoop to Smalltalk Available in vw- dev since August 29, 2006 Initialzing in class EventProcessingManager: pr im Ca llba ck Eve n t I n st a ll: aMethodSelector " Inform the VM of the callback class ( the receiver) and the callback invocation method selector for event processing." | regNames | regNames := ObjectMemory registrationNames. ((regNames includes: 'callbackEventClass') and: [regNames includes: 'callbackEventSelector']) ifTrue: [ ObjectMemory registerObject: self withEngineFor: 'callbackEventClass'. ObjectMemory registerObject: aMethodSelector withEngineFor: 'callbackEventSelector'] 60
  • 61. Eve n t loop in Sm a llt a lk Class EventProcessingManager runs the loop delegates all actions to the handler Implemented in EventHandler class hierarchy processEvents | eventRecord | handler canHandleMultipleEvents ifFalse: [self blockEvents ifTrue: [^self]]. [ eventRecord := handler eventRecord. [ handler nextEvent: eventRecord] whileTrue: [ handler handleEvent: eventRecord]. handler postHandleEvents] ensure: [self allowEvents] 61
  • 62. Su bcla sse s of Eve n t H a n dle r Exam ple m et hods in Win32Event Handler eventRecord ^ self MSG gcMalloc nextEvent: anEventRecord ^(self peekMessageA: anEventRecord window: 0 filterMin: 0 filterMax: 0 flags: (self PM_REMOVE bitOr: self PM_NOYIELD)) ~= self FALSE postHandleEvents ^ self 62
  • 63. OSt u dioEve n t H a n dle r Exam ple m et hods in OSt udioEvent Handler preTranslateMessage: msg <C: BOOL PreTranslat eMessage( LPMSG msg)> ^ self externalAccessFailedWith: _errorCode postHandleEvents System wantsBusyCursor ifTrue: [UI.Cursor wait showWhile: [System drainASendQueue]] ifFalse: [System drainASendQueue]. self onIdleApp onIdleApp <C: void OnIdleApp(void)> ^ self externalAccessFailedWith: _errorCode 63
  • 64. H a n dlin g a n e ve n t In Win32EventHandler handleEvent: anEventRecord self translateMessage: anEventRecord. self dispatchMessageA: anEventRecord In OStudioEventHandler handleEvent: anEventRecord ( self preTranslateMessage: anEventRecord) = self FALSE ifTrue: [ self translateMessage: anEventRecord. self dispatchMessageA: anEventRecord] 64
  • 65. Use r I n t e r r u pt s < ct rl> Y and < ct rl> < shift > Y work as in VisualWorks I m plem ent ed as Accelerat or Keys < ct rl> Y int errupt s t he running process by sending self halt : in a callBack from C 65
  • 66. Cla ss Pr ox ie s Class Proxies work They are shared variables in Root .Obj ect St udio.Global Loading put s class in Root .Obj ect St udio 66
  • 67. Applica t ion Loa din g Applicat ion loading works 67
  • 68. Pe r for m a n ce I ssu e s I n Classic Obj ect St udio Sm allt alk execut ion is slow Calling C prim it ives cost not hing I n VisualWorks Sm allt alk execut ion is fast Calling C is expensive I n Classic Obj ect St udio Perform ance crit ical m et hods are m oved t o C I n Obj ect St udio 8 Perform ance crit ical prim it ives are m oved back t o Sm allt alk 68
  • 69. Visu a lW or k s .st file - in is slow Of 1000 seconds 900 are RB refresh Of 100 seconds 90 are repeatedly relinking the system Of 10 Seconds 9 are disk flush (Changes file) 1 second compiling At t he end of t he opt im izat ions: Loading as alt ernat ive t o file- in Loading a .st is sim ilar speed as parcel loading Small .st/.cls files load faster than parcels Large parcel files load faster than .st/.cls files 69
  • 70. N e w Con ce pt s for Obj e ct St u dio Source Code Managem ent St ore Versioning system Database based Sm allt alk Archives File based One file per application Code purit y Undeclared Code Crit ic Overrides 70
  • 71. June 2005 Internal Alpha October 2005 Internal Alpha2 March 2006 Cincom internal testing April 2006 First Customer August 2006 First independent Service Partner May-September 2006 Solve incompatabilities, Refactoring, Performance issues October 2006 Next few customers December 2006 Preview 71
  • 72. Por t in g Pr oce ss Th e or y Theory Load applicat ion St art it 72
  • 73. Por t in g Pr oce ss Pr a ct ice Look at base syst em m odificat ions Like any ot her port ing t his is a source of m any problem s Known incom pat ibilit ies I m m ut abilit y Declare Pool Dict ionaries Export Modeling Tool definit ions in ASCI I Binary form at is incom pat ible 73
  • 74. Un de cla r e ds I n Classic Obj ect St udio Each undeclared variable is always considered a global I n VisualWorks and Obj ect St udio 8 Each undeclared variable is considered undeclared GHUndeclaredBrowser Shows all Undeclareds and t heir references I t uncovered som e very old Obj ect St udio problem s due t o t ypoes. 74
  • 75. Ta r ge t Look 75
  • 76. Aft e r loa din g M ode lin g Tool 76
  • 77. W h a t ca n ESUG Au die n ce le a r n ? I nt egrat ion of Sm allt alk syst em s is possible Which syst em s deserve t o be int egrat ed? VW and Squeak Very common systems VSE VA Smalltalk- X Dolphin Ruby Java Frost GemStone 77