I am designing a distributed file system, one of the core classes is the FileSystem class which looks like:
class FileSystem {
public:
exists(Path*);
insert_file(File*);
insert_block(Block*);
remove(Path*);
list();
update_file(File*);
update_block(Block*);
get_file(Path*);
get_block(Block*);
move(Path*, Path*);
copy(Path*, Path*);
...
... // More and more methods
};
I succeeded refactoring the project, however, I can not refactor this class, whenever I need to add a behavior (decorator or sub-typing) I ended up making more complex my design. Another problem is the amount of dependencies of this class (Path, block, file among others not included in the snippet).
The main cause is that this FS class has too many responsibilities, but still I can not find a way to split this File system class into different classes. I wonder if there is any pattern for this kind of situation, if not, how would you deal with this giant class?
Aucun commentaire:
Enregistrer un commentaire