-
Notifications
You must be signed in to change notification settings - Fork 116
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Additional docs for the kernel notifications, move them to inner class #242
Conversation
Hi @kyanha , By looking at this and the duplicate doc (and seems like there is no other ways like a "group" documentation :'( ), maybe we could have a subclass |
I don't have a problem with relocating these functions into a Dokan.NotifyTheKernel internal class (pick a better name, and please let me know what it should be), and adding documentation on that class for Doxygen to pick up and put into the docs. But, I have to be honest: I almost never look at the Doxygen documentation. Instead, I use Visual Studio's Intellisense lookup of the XML documentation, and its accessibility to people who didn't come up into programming through formal schooling. The I'll implement this, and if you want me to change the name of the internal class just let me know. (On a slight tangent: As far as I can see, we can't really do much handholding for the programmer as far as constructing the path to notify for. For |
For the documentation we are mostly using About |
@Liryna @Lukas0610 Could you please look this over? I moved the notification functions to an inner class per Liryna's comment, and I want to make sure the docs make sense. Again, if the inner class name doesn't make sense, I'll change it (or you can, since I marked 'allow maintainers to edit' on the PR). |
For the documentation, and it's of course just in my opinion, my proposed description at dokan-dev/dokany#833 describes the notification functions and how they should be used in a more clear way. |
Thank you @kyanha for the quick changes 👍 @kyanha I just merged #245 , you might want to pull/rebase to not have any merge conflict. |
How about (I discussed this with a couple professional programmer friends [one game programmer and one hardware/firmware/driver/user full-stack programmer], and they like the self-documenting nature of C#'s library structure. They preferred 'Dokan.Notify.ExternalOperation' as the method name schema. I will write it to whatever spec you choose; I just want to give it some thought before committing to a final design.) Edit to add: I implemented this without the 'External' prefix on the method names, to Lukas's spec as modified. After putting the docs on Dokan.Notify, it's a lot clearer that they are always external to the IDokanOperations implementation. |
Updates DokanOptions.EnableNotificationAPI doc to refer to methods instead of functions and the exposed method names. Updates sample/DokanNetMirror/Notify.cs to refer to new names.
|
I'd append a
|
Now we're getting into English grammar (its tense rules), and I'm not sure it makes sense to do it that way. To me, ExternalCreate suggests "an external create operation occurred" versus "A file was externally created". If we're going with English tense rules, I'd feel better with But that also gets into "XAttr Externally Updated", versus "an External XAttr Update operation occurred", which breaks the name of ExternalXAttrUpdated. When I told my friends I needed some help with method naming, one of the questions I was asked was, "Do the clients care about the source of the operation?" I said yes, because if the operation is through the standard filesystem operations the kernel already knows and doesn't need to be notified. If the operation is performed outside of the filesystem interface, it does. But thinking on it, I'm not so sure. Suppose you have a filesystem that exposes .jpg file JFIF data as a separate file: when a .jpg file is created, the filesystem automatically 'creates' a new .jfif file for it, and needs to notify the kernel of its creation and availability. In that case, the creation happens internal to the filesystem, and 'External' isn't really a good descriptor for it. (external to the filesystem? external to the kernel filesystem interface?). In the Mirror example, 'External' is a good descriptor, because everything that happens to it is external to the mirror's presentation. But not every implementation is going to need to notify based on externalities -- some implementations will need to notify based on internal actions that still don't come from the kernel. tl;dr: naming is hard. I'd like to withdraw my suggestion for prefixing the names with 'External'. This PR was already implemented without said prefix, and the docs make it clear that notifications only need to happen outside the normal IDokanOperations flow. |
For me, current state PR is good and documentation is more than enough thank to both of you. |
No problems on my side |
Thanks to both of you again @kyanha @Lukas0610 🏆 |
Adding additional remarks for the kernel notification functions.
DokanNetMirror
would learn about the need to call these functions fromSystem.IO.FileSystemWatcher
. A database-backed filesystem might learn about the need to call these if it queried the file name table, and compared it to its in-memory cache. Specifically, the notification functions tell the kernel about changes that happened outside of the normal filesystem flow. (Changes that happen as a result of normal filesystem calls are automatically known by the kernel, but things that happen to the filesystem as a result of external events aren't.)