filicious / core

Filicious is a high level object oriented filesystem abstraction for PHP.
https://filicious.github.io/
31 stars 9 forks source link

Make the File implementations more lightweight #40

Closed backbone87 closed 11 years ago

backbone87 commented 11 years ago

By sharing one basic File implementation accross all (most) Filesystem implementations.

I do not want to change the interfaces. Only the implementation (specifically the AbstractFile and AbstractFilesystem implementation).

For example filesize: The Filesystem determines how big a file behind a pathname is

public abstract function AbstractFilesystem::getSize(File $file);
public function BaseFile::__construct(AbstractFilesystem $fs);
public function BaseFile::getSize() { return $this->fs->getSize($this); }

although clearify's the abstraction: The File object just abstracts a pathname within a specific filesystem. The Filesystem should decide how to access/manipulate/retrieve meta data from a pathname.

tristanlins commented 11 years ago

I don't see the necessity or improvement of this. File related operations should be in the File object. Also the implementation. File will not be more lightweight if you extract the implementation of the methods into the Filesystem class. You just bloat the Filesystem class.

This would also complicate the usage of the API. The developer may not know what to use: $file->getSize() or $fs->getSize($file)

backbone87 commented 11 years ago

After talking in skype to tristan, we come to the conclusion, that his interpretation was a misunderstanding due to my falsy original ticket text. I clarified (hopefully)

discordier commented 11 years ago

This is implemented with the Simple* classes, isn't it?

tristanlins commented 11 years ago

The Simple*-Classes does not exist anymore.