Definitions

Objective-J

Objective-J

Objective-J is a programming language based on JavaScript and Objective-C. Objective-J adds traditional inheritance and Smalltalk/Objective-C style dynamic dispatch, among other things, to pure JavaScript. Objective-J shares the same relationship with JavaScript as Objective-C shares with C, so it is a strict superset of JavaScript.

Programs written in Objective-J can be preprocessed into pure JavaScript in the browser, so no separate compilation step is required. Furthermore, the Objective-J preprocessor itself is written in JavaScript, so no plugins are required. Alternatively, Objective-J code can be preprocessed once on the server to eliminate the preprocessing cost once the application is deployed.

Application

Objective-J is intended for making web applications rather than websites or web-pages. 280slides.com, an online presentation creation tool, is the first web application demonstrated using Objective-J.

Syntax

Objective-J is a superset of JavaScript, meaning any valid JavaScript code is also valid Objective-J code.

Here's an example class inheriting from CPObject class:

@implementation Address : CPObject
{
  CPString name;
  CPString city;
}

-(void)setName:(CPString)aName {

     name = aName;
}

-(CPString)name {

     return name;
}

+(id)newAddressWithName:(CPString)aName withCity:(CPString)aCity {
     self = [super init];
     name = aName;
     city = aCity;
     return self;
}

@end

In this example, an Address class is implemented, derived from the CPObject class. It is followed by two instance methods, for setting the name and getting it back. Instance methods are preceded by a '-' (dash), while class methods are preceded by a '+' (plus).

See also

External links

  • http://cappuccino.org/learn/tutorials/objective-j-tutorial.php

Search another word or see Objective-Jon Dictionary | Thesaurus |Spanish
  • Please Login or Sign Up to use the Recent Searches feature
FAVORITES
RECENT