Don’t Fear the Platform
    Integrating GemStone and OS X
Mac OS X


• Programming Language: Objective-C
• Libraries: Cocoa (Foundation / AppKit)
Objective-C
             The Good

• Superset of C
• Smalltalk message passing semantics
• Class extensions
• Optional compile-time type checking
Objective-C
               The Bad

• Not everything is an object
• Blocks were not added until OS X 10.6
• Garbage collection is optional
• become: is nowhere to be found
Cocoa
              The Good


• Well-designed views (widgets)
• Interface Builder
• CoreData for local applications
Cocoa
              The Bad



• No network-ready data store
GsKit
                 Goals


• Make GemStone object instances first-class
  citizens in the Objective-C runtime
• Be simple
GemStone Browser
GsKit
                             Usage

GSConnection * con = [GSConnection new];
BOOL success = [con connectToStone:@"!tcp@localhost#server!seaside"
                             asUser:@"DataCurator"
                       withPassword:@"swordfish"
                       usingService:@""];
id anAssociation = [con execute:@" 'ice cream' -> 'gelato' "];
[anAssociation key];            // @"ice cream"
[anAssociation value];          // @"gelato"
[anAssociation class];          // GSProxy
// Estem en Catalunya, doncs...
[[anAssociation key:@"helado"] value:@"gelat"];
[anAssociation displayString]; // @"'helado'->'gelat'"
GsKit
                  Implementation
• Immutable types are copied:
 •   String > NSString

 •   Number > NSNumber

 •   Boolean > NSNumber (what the...?)

• Collections are specially wrapped:
 •   Dictionaries are wrapped in GSDictionary

 •   OrderedCollections are wrapped in GSArray

• All other objects (for now) are “GSProxy”
Demonstration
Unresolved Issues


• Boolean values
  •   Objective-C can’t tell a bool from a number!


• Lack of Interest
Future Features

• Multi-user Change Notification
• Automatically persisting ObjC classes
  •   Just storing instance variables, logic would stay in Objective-C


• Dynamically create ObjC proxy classes
• Magritte?
A Smalltalk Sandwich

Don't Fear the Platform

  • 1.
    Don’t Fear thePlatform Integrating GemStone and OS X
  • 2.
    Mac OS X •Programming Language: Objective-C • Libraries: Cocoa (Foundation / AppKit)
  • 3.
    Objective-C The Good • Superset of C • Smalltalk message passing semantics • Class extensions • Optional compile-time type checking
  • 4.
    Objective-C The Bad • Not everything is an object • Blocks were not added until OS X 10.6 • Garbage collection is optional • become: is nowhere to be found
  • 5.
    Cocoa The Good • Well-designed views (widgets) • Interface Builder • CoreData for local applications
  • 6.
    Cocoa The Bad • No network-ready data store
  • 7.
    GsKit Goals • Make GemStone object instances first-class citizens in the Objective-C runtime • Be simple
  • 8.
  • 9.
    GsKit Usage GSConnection * con = [GSConnection new]; BOOL success = [con connectToStone:@"!tcp@localhost#server!seaside" asUser:@"DataCurator" withPassword:@"swordfish" usingService:@""]; id anAssociation = [con execute:@" 'ice cream' -> 'gelato' "]; [anAssociation key]; // @"ice cream" [anAssociation value]; // @"gelato" [anAssociation class]; // GSProxy // Estem en Catalunya, doncs... [[anAssociation key:@"helado"] value:@"gelat"]; [anAssociation displayString]; // @"'helado'->'gelat'"
  • 10.
    GsKit Implementation • Immutable types are copied: • String > NSString • Number > NSNumber • Boolean > NSNumber (what the...?) • Collections are specially wrapped: • Dictionaries are wrapped in GSDictionary • OrderedCollections are wrapped in GSArray • All other objects (for now) are “GSProxy”
  • 11.
  • 12.
    Unresolved Issues • Booleanvalues • Objective-C can’t tell a bool from a number! • Lack of Interest
  • 13.
    Future Features • Multi-userChange Notification • Automatically persisting ObjC classes • Just storing instance variables, logic would stay in Objective-C • Dynamically create ObjC proxy classes • Magritte?
  • 14.