سؤال

I'm trying to model a system where I have directories with files. A directory contains files as well as directories.

I found a good method to represent a tree in an SQL database (http://falsinsoft.blogspot.com/2013/01/tree-in-sql-database-nested-set-model.html) -- the article describes the method named "nested set" but I have problems on how to model it in UML (class diagram).

هل كانت مفيدة؟

المحلول

Here is a class diagram that represents the situation:

enter image description here

Compositions are used to reflect the fact, that if a Directory is deleted, all its contents (subdirectories and siles) are automatically also deleted.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top