Skip to content

refactor: implement single-package architecture (ADR-007 Option B)#5

Merged
MarketDataDev03 merged 1 commit into
mainfrom
05_implement_single_package_arq
May 11, 2026
Merged

refactor: implement single-package architecture (ADR-007 Option B)#5
MarketDataDev03 merged 1 commit into
mainfrom
05_implement_single_package_arq

Conversation

@MarketDataDev03

Copy link
Copy Markdown
Collaborator

refactor: implement single-package architecture (ADR-007 Option B)

Branch 05_implement_single_package_arqmain · 1 commit · 13 files · +36 / −36

Implements Option B from ADR-007: collapses the com.marketdata.sdk.internal subpackage into the SDK root and drops the public modifier from every infra class so the consumer's compiler simply cannot reference them. Closes the "internal types leak via public constructor signatures" gap that every non-modular Java SDK has, with pure Java visibility — no JPMS, no module-info, no asterisk on classpath consumers.

What's included

Source moves + visibility drop

Four infra classes move from com.marketdata.sdk.internalcom.marketdata.sdk (root) and switch from public final class to final class (package-private):

Old path New path Modifier
internal/Configuration.java Configuration.java public final classfinal class
internal/EnvVars.java EnvVars.java public final classfinal class
internal/Tokens.java Tokens.java public final classfinal class
internal/Version.java Version.java public final classfinal class

The internal/package-info.java is deleted; the directory disappears from the source tree. After this PR:

src/main/java/com/marketdata/sdk/
├── MarketDataClient.java         public      ← API
├── RateLimits.java               public      ← API
├── Configuration.java            (package-private)
├── EnvVars.java                  (package-private)
├── Tokens.java                   (package-private)
├── Version.java                  (package-private)
├── package-info.java
└── exception/                    ← public exceptions, unchanged

A consumer attempting import com.marketdata.sdk.Configuration; will not compile — the type is invisible from outside the package. The same will apply to every infra class that lands in subsequent endpoint work (HttpTransport, RequestSpec, AsyncSemaphore, deserializers, etc.).

Test moves

The matching unit tests move alongside their subjects so they keep package-private access:

Old path New path
test/.../internal/ConfigurationTest.java test/.../ConfigurationTest.java
test/.../internal/TokensTest.java test/.../TokensTest.java

MarketDataClientTest.java did not move (already in root) but its stale import com.marketdata.sdk.internal.Configuration is removed — references to Configuration.DEFAULT_BASE_URL etc. resolve via same-package access now.

MarketDataClient

The four import com.marketdata.sdk.internal.* lines are removed. No body change — the resolution code (Configuration.loadFromProcess(), Tokens.redact(...), Version.current(), EnvVars.TOKEN) all still works because everything is now in the same package.

What is not in this PR

  • No changes to the public API contract (MarketDataClient constructors, RateLimits, exception hierarchy — all unchanged).
  • No new resources. The markets/, stocks/, options/, funds/, utilities/ resource façades will land in subsequent branches and will follow the same convention by construction (resource class is public final class in the root, constructor is package-private, internal helpers stay package-private alongside).
  • No JPMS / module-info.java. Per ADR-007's rejected Option A, JPMS is available as a complementary measure later if modulepath signal becomes desirable on top of the compile-time enforcement Option B already provides.

@MarketDataDev03 MarketDataDev03 self-assigned this May 8, 2026
@codecov

codecov Bot commented May 8, 2026

Copy link
Copy Markdown

The author of this PR, MarketDataDev03, is not an activated member of this organization on Codecov.
Please activate this user on Codecov to display this PR comment.
Coverage data is still being uploaded to Codecov.io for purposes of overall coverage calculations.
Please don't hesitate to email us at support@codecov.io with any questions.

@MarketDataDev03 MarketDataDev03 merged commit 557cf8e into main May 11, 2026
5 checks passed
@MarketDataDev03 MarketDataDev03 deleted the 05_implement_single_package_arq branch May 11, 2026 14:26
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

Successfully merging this pull request may close these issues.

2 participants