deephaven / deephaven-core

Deephaven Community Core
Other
259 stars 80 forks source link

Refactor java-client examples #1767

Open devinrsmith opened 2 years ago

devinrsmith commented 2 years ago

@niloc132 points out that java-client examples are misnamed, and have conceptual overhead more than just the DHC client library (for example, picocli as a means of argument parsing for CLI tools).

It may make sense to rename the current examples as "tools", and to extract logical DHC client library chunks into "examples".

abaranec commented 1 year ago

I was recently trying to use the examples to understand how to properly use Console Sessions as part of an Enterprise ticket. I found them pretty difficult to grok down into a targeted example that covered the steps of what I needed to do.

They are very pretty from an engineering standpoint, that so little code can end up being as rich as a complete console session. It would have saved a lot of time if they were less beautiful, but more self contained and complete on a per example basis, with better line-by-line comments about what the guts are actually doing and whatever gotchays there are.

For example, when creating the session, you can do it directly, or via factory with dagger. Why would you choose one over the other? Does it matter?

There is a scheduler that gets passed in there, does that need to be global? should it be unique to each channel? session?

that level of verbosity would be really helpful

devinrsmith commented 1 year ago

It's a fair criticism @abaranec.

I can work on a less abstracted example that shows the complete setup of a session in a single file. It will be more limited in scope (ie, won't have configuration hooks for SSL and such), but hopefully it will be generally instructive.

niloc132 commented 1 year ago

Alternatively, since these are apparently unused even internally, it might make sense to remove most of the "useful, but boring" abstractions, so that we have clear examples of how to use the various components of the library, and ensure that they work from build to build via tests.

If they were otherwise being used on a regular basis it might make sense to have both, but I'm not sure what purpose these serve any more.