Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

API Design

5,171 views

Published on

Published in: Technology

API Design

  1. 1. Design Better API, for You, for Your Friends, and for the World!
  2. 2. http://www.eddie.com.twaquarianboy@ptteddie@digik.com.twaquarianboy@plurkeddiekao@facebook
  3. 3. http://en.wikipedia.org/wiki/Application_programming_interface
  4. 4. // Win32 APIConvertSecurityDescriptorToStringSecurityDescriptor // 51// Cocoa FrameworkNSAccessibilityLayoutPointForScreenPointParameterizedAttribute // 62// UIKitdelegateTitleForDeleteConfirmationButtonForRowAtIndexPath // 57
  5. 5. //gotoAndStop(); ////gg(); // gg ?
  6. 6. //gAS // gotoAndStop();gAP // gotoAndPlay();
  7. 7. // MyClass.aspublic class MyClass{ private var strTitle:String; private var _price_code:int; public function get_price_code ():int { return _price_code; } public function setPriceCode (arg:int):void { _price_code = arg; } ..}
  8. 8. ㊢寫
  9. 9. // MyClass.aspublic class MyClass //{ public static const NAME:String // private var _price:int; // private public function get_price_code():int // function { return _price; } public function set_username(name:String):void // { var age:int = 30; // }}
  10. 10. // Member.aspublic class Member{ ... public function member_info():String { .... } public function get_member_info():String { .... } public function user_info():String { .... } public function get_user():String { .... } ..}
  11. 11. // MyClass.aspackage tw.eddie.com { public class MyClass { ... private var _title:String; // public function get_price_code ():int { return _price_code; } .. }}
  12. 12. // BookStore.aspublic class BookStore{ ... public function setBookInfo (bookname:String, author:String, total_page:int,amount:int, price:int, publish_date:String, is_available:Boolean):void { ... } ..}
  13. 13. //book = new Book("Hello AS3", 1, 320, 550, "2011/6/21");// ?book = new Book();book.name = “Hello AS3”;book.amount = 1;book.page = 320;book.price = 550;book.publish_date = “2011/6/21”
  14. 14. // MyClass.aspublic class MyClass{ ... public function set_user (username:String = “guest”):void { ... } ..}
  15. 15. // ?book = new Book(“hello AS3”, true, false);//book = new Book(“hello AS3”, Book.IS_AVAILABLE, Book.IN_STOCK);
  16. 16. // BookStore.as/** * BookStore ... * * */public class BookStore{ /** * ASDoc */ public function setBookInfo(book:Book):void { ... } ..} http://livedocs.adobe.com/flex/3/html/help.html?content=asdoc_9.html
  17. 17. // BookStore.aspublic class BookStore{ ... public function setBookInfo(book:Book):void { book.count += 1; // 1 ... } ..}
  18. 18. I’m Looking forAS3/Ruby/Rails/iOS Developers
  19. 19. WorkingWithEddie@gmail.com
  20. 20. Thank You! 2011/6/21 Kaos’ Digital Network, Ltd. TEL +886-2-2682-4700No.26, Ln. 248, Junying St., Shulin Dist., New Taipei City 238, Taiwan (R.O.C.) Welcome to visit http://digik.tw for more information!

×