在哪里找到“模板”接口?

i wonder where one can find template interfaces.

eg. i am creating these classes that implements iLog:

 DatabaseLog
 ScreenLog
 FileLog

i wonder what methods should a typical Log class have?

is there a set of interfaces you could just implement/learn from rather than reinvent the wheel and have to think about the method names.

eg. Interfaces:

 iLog
 iDatabase
 iErrorMessage
 etc.

Thanks

PHP defines the following interfaces (should, but may not be complete):

  • Traversable — The Traversable interface
  • Iterator — The Iterator interface
  • IteratorAggregate — The IteratorAggregate interface
  • ArrayAccess — The ArrayAccess interface
  • Serializable — The Serializable interface
  • Countable — The Countable interface
  • OuterIterator — The OuterIterator interface
  • RecursiveIterator — The RecursiveIterator interface
  • SeekableIterator — The SeekableIterator interface
  • SplObserver — The SplObserver interface
  • SplSubject — The SplSubject interface

See

As for your Logger Interface, I'd say it should have a method log($message, level) and nothing else.