Skip to content
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

More flexible API for file management and syncing #149

Closed
piotrtomiak opened this issue Oct 14, 2014 · 7 comments
Closed

More flexible API for file management and syncing #149

piotrtomiak opened this issue Oct 14, 2014 · 7 comments
Milestone

Comments

@piotrtomiak
Copy link
Contributor

Genuitec proposes to make some API cleanup/reorganization within File management and synchronisation, especially defining class roles in a better way. Here is a very raw draft of proposed changes:

  1. FileManager or better IFileCacheManager, would be responsible for keeping up-to-date list of files on the server
    • IFileCacheManager would work on ITernFile interface and all details of accessing file contents would be responsibility of ITernFile objects
  2. File access would be done through ITernFile, with IDETernFile supporting both IFile and File (and possibly others). Public methods:
    • getName()
    • getContents()
    • getAdapter(class) -> returns IFile or File dependeing on the queried class
    • getRelativeFile(String relativePath)
  3. ITernProject would not perform any synchronization code itself but redirect any such operations to IFileCacheManager
  4. Adpoters will be able to provide different implementations of IFileCacheManager, ITernProject and ITernFile (through appropriate factories).
@angelozerr
Copy link
Owner

@piotrtomiak I like your idea. The only thing I would like to keep is that all classes from https://github.com/angelozerr/tern.java/tree/master/core must be NOT linked to Eclipse classes. Indead those classes could be used for other IDE (Intellij, Netbeans, etc).

@vrubezhny @dgolovin @mickaelistria @maxandersen @pascalleclercq @gamerson @paulvi @fbricon I think it's an important changes, any comments are welcome. Thank's!

@piotrtomiak do you think it's possible to have a PR for that?

@piotrtomiak
Copy link
Contributor Author

@angelozerr I see the pattern in core and any proposed mechanisms will be generic, that is not linked to Eclipse in any way

Yes, I will create PR ASAP. Working on changes now.

@angelozerr angelozerr added this to the 0.7.0 milestone Oct 14, 2014
@angelozerr
Copy link
Owner

@piotrtomiak I'm waiting for your PR.

Just one question is ITernFile the same thing than TernFile? If it that that's cool, otherwise I would like to avoid creating an instance of ITernFile for IFile and after an instance of TernFile. I think ITernFile an dternFile should be merged. Waiting for your PR...

@piotrtomiak
Copy link
Contributor Author

@angelozerr That's a good idea, I haven't thought about that. I will see whether this is possible, but it should be. PR should be ready tomorrow morning.

@paulvi paulvi mentioned this issue Oct 15, 2014
piotrtomiak added a commit to piotrtomiak/tern.java that referenced this issue Oct 15, 2014
piotrtomiak added a commit to piotrtomiak/tern.java that referenced this issue Oct 15, 2014
@piotrtomiak
Copy link
Contributor Author

@angelozerr PR has been created. It took me much more time then I expected, but I think results are worth it. I have tried to describe changes as best as I can. They are vast, but only in file management area. I haven't tried to add any new functionality here (like support for URL based files, or script paths from outside of workspace), but all of that and much more, will now be possible.

ITernFile and TernFile could not be merged together as their nature is different, however, I have created a utility method (ITernFile.toTernServerFile) which takes care of the conversion and allows for custom conversions for particular files.

@maxandersen
Copy link

just to link these together the PR is at #154

angelozerr added a commit that referenced this issue Oct 20, 2014
Issue #149: reorganization of file managment API.
@piotrtomiak
Copy link
Contributor Author

@angelozerr since pull request has been merged, I guess you could close this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants