Open nebulousGirl opened 8 years ago
I just saw that the function is static that would explain why a new instance is returned, but why is fromFile not static?
This cannot be resolved without breaking changes. It is essentially a naming problem.
There are methods like setResource and setData that do not create new instances, but no setFile method.
And there are fromData and fromResource which create a new instance while fromFile does not.
That kind of inconsistencies can be confusing when you start using a library. To fix the issue, fromFile would have to return a new instance and a setFile method should be created with the current behavior from fromFile.
Is a new major version planned to correct this issue?
Hello,
Actually, the fromFile that creates an instance is open ()
I agree that the namd is not really good, one could ask what it would break to change this
fromFile only changes the source, but fromData creates a new instance losing any configuration previously set (like the cacheFolder)
Is there a reason why a new instance is created only for fromData?