i want to make my own class to make my code useful and easy.
i want to replace (for example)
$facebook->api('/me');
to
$myclass->me();
to post on wall for example i need to write
$facebook->api('/me/feed','post',$atch);
i want to make it
$myclass->msg($msg);
how can i make my own class using facebook class (and i using another DB class)
thanks for halp
Option #1 – quick, easy, common practice for OOP
Option #2 (alternative) – easyier to maintance, won’t collide with base class properties, easy to extend. It’s like API for API 🙂
2nd option is better when your class uses lot of keywords and may collide with base API class. Easyier to maintance, easier to extend.
I used to work with many API’s (ebay,paypal,amazon,fb etc).
I usually create 2-3 classes:
I know using
extendthe is most common practice, but personaly I preffer option #2.