Hi,
I am writing a set of classes: RAR, ZIP and Trip. They all share a common interest: they are archive formats. So, I initially thought about doing this:
1) Write a base abstract class
abstract class Archive {}
and place it at "libraries/archive/archive.php".
2) Write zip, rar and trip classes
class Archive_Zip extends Archive {}
and place them at "libraries/archive/zip.php"
3) Access the specific class (e.g. the Zip) like this
$this->archive->zip->...
This was my initial approach. However, do you think this is a good approach? Should I even abstract them at the first place? What are the pros and cons of just writing a "libraries/zip.php" file (and all others separately)?
Do you have any suggestions or arguments against my approach? Is there something bad I have done?