Entities
There are two kinds of objects that represent things, entities and value objects. Entities are objects with an unique identity, such as Nellie or David's car, while value objects are objects that we use for their values, such as five or green.
In Java, java.io.File
objects are value objects. They represent
paths (absolute or relative) in the file system. Any number of File
objects may reference the same path. The path that a File
object references may or may not contain a file. If a file referenced by a
File
object moves away and
someone puts a directory there instead, it is still referenced by the same
File
object. If the directory is deleted and a file is put there
again, the File
object is still valid. The part of the application
that holds the File
object may be totally unaware of what has
happened and, worse, may still assume that the File
object still
references the original file.
In EntityFS, file system entities (files and directories, mostly) are treated
as entities. Only one org.entityfs.EFile
object instance may reference a
file in the file system. If, for instance, another part of an application
wants to use the same file, it uses the same EFile
instance. If
it moves the file, the same EFile
still represents the file,
and it is updated with the file's new location. Everyone that uses that
EFile
object will see what has happened and can respond to that
if they want to.
You can read more on this in the Architecture overview. An excellent book on the subject is Domain Driven Design by Eric Evans.