Header

  1. View current page

    정상혁의 수첩

Profile_img_60x60_08
195

API design

How to Design a Good API & Why it matters - Joshua Bloch

http://www.infoq.com/presentations/effective-api-design  (Javapolis 2005)

http://video.google.com/videoplay?docid=-3733345136856180693 (google에서 강연)

Joshua Bloch: Bumper-Sticker API Design

 

http://www.se-radio.net/podcast/2009-08/episode-143-api-design-jim-des-rivieres

User Interface Principle in API Design

How to Design a API

Java API Design Guidelines

Java Collections API Design FAQ

JSRs aren't appropriate for classlibraries

JSRs aren't appropriate for classlibraries 를 읽고

API 설계 헌장(API design manifesto)

Cactus API design rules

Java API Design Guidelines

http://www.codeproject.com/KB/java/aQuicklookatAPIDesign.aspx

 

APIs can be among a company's greatest assets.

Can also be among company's greatest liabilites.

Public APIs are forever- one chance to get it right.

 

If you program, you are an API designer.

Useful modules tent to get reused.

Thinking in terms of APIs impoves code quality.

 

Characteristics of a Good API

  • Easy to learn
  • Easy to use, even without documentation.
  • Hard to misuse. 
  • Easy to read and maintain code that uses it 
  • Sufficiently powerful to satisfy requrements. 
  • Easy to Extend Appropriate to audience 

 

요구사항보다 보다 일반적인 것 

 심지어 가장 뛰어난 디자이너도 실수를 한다.

 

 General Principle

  • API should do one thing and do it well 

functionality shoud be easy to explain 

 If it's hard to name, that's generally a bad sign.

Good names drive development

Amendable  

 

API shoud be as small as possible but no smaller  

You can always add, but you can never remove 

 

Implmentations should not impact API 

 

Minimize accessibility of everty 

 

Make classes and members as private as possible 

public classes shoud have no public fields (with the exception of constants) 

 

  • Name should be largely self-explnatory 

avoid cryptic abbreviation 

  • Be consistent-same word means same thing. 

 

API must coexist peacefully with platform. 

 

Minimize mutabillity 

 

bad: Date, Calendar 

Simple, thread-safe,  

 

is-a relation 

Stack extends Vector 

 Properties extends HashTable

 

Don't make the client do anything the module could do 

 

 

Class 

 

Method 

 Fail fast-report errors as soon as possible after they occur.

 

Compile time is best. static typing, generics.

 

 

SoC(Separation of Concerns)는 복잡도를 증가시키는가?

복잡함을 상대하는 기본적인 전략 - SoC

 

Static

http://www.jroller.com/cyrille/date/20050414

 

응집도와 결합도

http://www.threeriversinstitute.org/blog/?p=104

 

사이트

http://wiki.apidesign.org/wiki/APIDesignPatterns

 

History

Last edited on 05/25/2010 22:03 by benelog

Comments (0)

You must log in to leave a comment. Please sign in.