Decorator for allowing to associate additional properties (and possibly behaviour) to file system nodes.
Iterator for traversing the file system in different ways
Factory for creating file system nodes with different backends (e.g. a disk-based file system or a memory-based file system or a remote file system).
I think that this general approach of trying to apply all the patterns you can is wrong though, it's easy to overengineer your software like that. The key insight with design patterns is to realize when you should not apply a pattern.
发布评论
评论(2)
如果您确实在寻找设计文件系统时要应用的设计模式列表,则应该考虑使用
我认为这种尝试应用所有可能的模式的一般方法是错误的,这样很容易过度设计你的软件。设计模式的关键见解是认识到什么时候不应该应用模式。
If you're really looking for a list of design patterns to apply when designing a file system, you should consider
I think that this general approach of trying to apply all the patterns you can is wrong though, it's easy to overengineer your software like that. The key insight with design patterns is to realize when you should not apply a pattern.
听起来像是家庭作业。但是,至少检查以下模式:
您还应该在 google 中搜索“文件系统设计模式”以找到大量示例。最后,阅读一篇很好的设计模式简介。
Sounds like homework. However, check out at least the following patterns:
You should as well google for "filesystem design patterns" to find lots of examples. Finally, read a good introduction to design patterns.