Objective-C

Small Static Factory Methods

You know how Cocoa classes generally have static methods that serve as factories? return [NSArray arrayWithObjects:obj1, obj2, nil]; That’s a dumb example, especially now that you can do @[obj1, obj2], but why not do the same in AS3? For instance: return TransactionResponse.FailedResponse(); This would replace something like: var response:TransactionResponse = new TransactionResponse(); response.success = true; […]

More