Replies: 3 comments
-
Just realised that these rules might be too restrictive, for example:
With proposed rules CompositionRoot.fs can't see Module1 and Module2. It can be changed to smth more subtle but it quickly becomes too unintuitive so probably the idea is garbage. |
Beta Was this translation helpful? Give feedback.
-
Finishing thoughts: the whole idea was inspired by Dependency Validation Diagrams in VS Enterprise Edition but that's free and works only for C# and VB.NET anyway |
Beta Was this translation helpful? Give feedback.
-
Hmm. I don't think we'd consider a feature where visibility of constructs would be controlled by being placed in folders and subfolders. That could get pretty complex from a user experience standpoint, since IIRC there isn't much precedence for that kind of thing in other languages. I could be wrong about that though. This would be quite restrictive though, and I don't know if many people would use use. You can already control visibility via namespaces/subnamespaces and modules, so this would give several ways to accomplish the same thing, and having more ways for addressing visibility could also be difficult for people to grok. |
Beta Was this translation helpful? Give feedback.
-
One of killer features of F# is enforced order of dependencies (code above doesn't know about code below).
I know it annoys people but I actually love it as it helps to contain coupling.
It would be really good if there was an option (perhaps with a compiler option or pragma?) to further reduce visibility of code by using folders:
Consider source files in order:
Here Module2 can see all code exposed by Common.fs and also Module1.fs. Would be nice if Module2.fs could see only its siblings and ancestors (in this case only Common.fs but it's easy to come up with deep and large tree of dirs).
The only known workaround is to create separate projects and carefully watch their dependencies, which is not ideal if you want to keep DLL as a unit of deployment.
Here's a related SO question
https://stackoverflow.com/questions/56734887/isolate-modules-within-one-f-project-using-folders-is-it-possible
Beta Was this translation helpful? Give feedback.
All reactions