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

Classes doing work beyond their scope #70

Closed
1 of 5 tasks
Jeremy-Gaillard opened this issue Apr 1, 2016 · 7 comments
Closed
1 of 5 tasks

Classes doing work beyond their scope #70

Jeremy-Gaillard opened this issue Apr 1, 2016 · 7 comments

Comments

@Jeremy-Gaillard
Copy link
Contributor

There's a recurring design issue in the current implementation. A lot of classes do no limit themselves to their role and undertake actions out of their scope. This is very detrimental to the reusability of the classes.

Let's take WMTS_Provider as an example.

The role of the WMTS provider is to implement the WMTS protocol. You give it server information, a tile coordinate, and it gives you an image. Nothing more, nothing less. No assumptions should be made on how the developer will use the class.

Currently, the WMTS provider has:

  • Specific functions to retrieve elevation textures and height textures. The provider doesn't care what you'll use the texture for. If you want to fetch textures form different layers, just instantiate two providers.
  • Manipulation of tile data. There lies the biggest problem: a class meant to retrieve images from a server is changing the model. Because of this, you can't reuse the class for other purposes than terrain tile creation. The code is harder to understand because the update logic is scattered across multiple classes. The role of the class is no longer clear.

I think the architecture of iTowns as it is now has potential. But the way some classes are implemented makes it really difficult to use and to integrate foreign code into it.

Partial list of classes affected by this problem, followed by the functions that are out of place:

Debatable:

  • Quadtree: up, down, upSubLayer seem out of place. Quadtree's role doesn't seem precisely defined at the moment (BrowseTree #54 has propositions regarding this)
@gchoqueux
Copy link
Contributor

-yes, WMTS_Provider requires work.
-I move addImageryLayer, addElevationLayer.
-TileMesh: use of WMTS coordinates -> I will clean

gchoqueux added a commit that referenced this issue Apr 4, 2016
@Jeremy-Gaillard
Copy link
Contributor Author

I'm adding ManagerCommands.deQueue to the list.
I don't know exactly how to change it to keep the ability to cancel commands (cancel attribute?), but in the current state, it can cause (already caused in fact) issues that are hard to debug.

@gchoqueux
Copy link
Contributor

Cancel commands is a very important function. It removes all obsolete commands. It avoids a large amount requests.

@Jeremy-Gaillard
Copy link
Contributor Author

I agree, cancelling commands is important.
But I think the decision whether or not a command should be cancelled must not be done by the managerCommand. Maybe in the clean pass?

@gchoqueux
Copy link
Contributor

the managerCommands manages the commands. This is the best place to decide which command should be execute.

@gchoqueux
Copy link
Contributor

gchoqueux commented Nov 15, 2016

TileMesh: use of WMTS coordinates

I think is removed

WMS_Provider: urlGlobalIR

I think is removed

WMTS

Several thinks are changed can you updated your issue?

@Jeremy-Gaillard
Copy link
Contributor Author

Seems like all the issues I pointed out were solved. Closing.

NikoSaul pushed a commit to NikoSaul/itowns2 that referenced this issue Jul 4, 2017
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

2 participants