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

Parameter Finder Class #2

Open
judgej opened this issue Oct 5, 2015 · 1 comment
Open

Parameter Finder Class #2

judgej opened this issue Oct 5, 2015 · 1 comment

Comments

@judgej
Copy link
Owner

judgej commented Oct 5, 2015

All the classes so far are defined using low-level parameters. There are many pre-defined sets of parameters that are names and tabulated. These include ellipsoids, datums, projections, and a few other settings. There are a core set that are often used, but the full range is vast, and not available in any one place (so far as I can see).

So when creating a new Ellipsoid, for example, it would be good just to be able to give it a name (e.g. "airy") and have the details looked up. Those details may be pre-defined in the plugin, may be in a database, may need a HTTP API lookup, may be registered locally by the application - all these sources need a common interface that these classes can use without having to know where the final source of those details is.

That interface could be injected into each class to help when constructing. Or perhaps injected into an object factory? Whichever way it works, creating new objects in this package needs to go through some instantiated object or class (that references a global /shudder/ of some sort) that knows where to look things up. Maybe it looks for a factory in its own namespace, so any third-party library can define that library if it wants to hook in. It is a method of hooking in that we are essentially looking for.

@judgej
Copy link
Owner Author

judgej commented Oct 5, 2015

This could be implemented through namespaces: if each list of definitions is defined in a given namespace, as classes meeting a given interface, then named settings could be found using class_exists(). The disadvantage would be not being able to get lists of supported named settings groups like this, since you don't know, with an autoloader, what classes are available in a namespace until you try loading those classes.

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

1 participant