Skip to content

Refactor DsnRename into DsnUpdate and introduce immutable rename input - #572

Merged
frankgiordano merged 1 commit into
mainfrom
jul14
Jul 15, 2026
Merged

Refactor DsnRename into DsnUpdate and introduce immutable rename input#572
frankgiordano merged 1 commit into
mainfrom
jul14

Conversation

@frankgiordano

Copy link
Copy Markdown
Collaborator

Summary

Refactor DsnRename into DsnUpdate to establish a single entry point for dataset update operations and provide a foundation for supporting additional z/OSMF dataset update APIs in the future.

As part of this refactor, the rename API has been redesigned to use an immutable input object instead of overloaded methods with positional parameters.

Changes

  • Renamed DsnRename to DsnUpdate.

  • Introduced an immutable RenameInputData class to encapsulate rename request parameters.

  • Replaced the overloaded rename methods with a single:

    Response rename(RenameInputData inputData)
  • Centralized input validation within RenameInputData.

  • Removed mutable request state from the implementation.

  • Replaced internal varargs helper methods with strongly typed input.

  • Updated unit tests, documentation, and examples to reflect the new API.

Benefits

  • Provides a scalable design for future dataset update operations.
  • Simplifies the public API by exposing a single rename method.
  • Eliminates ambiguity caused by positional method parameters.
  • Improves type safety through immutable input objects.
  • Centralizes validation and reduces duplicate validation logic.
  • Improves maintainability by separating request construction from execution logic.

Example

Before

DsnRename rename = new DsnRename(connection);

rename.dataSetName(sourceDataSet, destinationDataSet);

rename.memberName(dataSetName, sourceMember, destinationMember);

After

DsnUpdate update = new DsnUpdate(connection);

update.rename(
    RenameInputData.forDataSet(
        sourceDataSet,
        destinationDataSet));

update.rename(
    RenameInputData.forMember(
        dataSetName,
        sourceMember,
        destinationMember));

This refactor does not change the underlying z/OSMF rename functionality. It modernizes the API and establishes a consistent, extensible design for future dataset update operations.

@frankgiordano frankgiordano self-assigned this Jul 15, 2026
@frankgiordano frankgiordano added enhancement New feature or request Improvement labels Jul 15, 2026
@frankgiordano
frankgiordano merged commit ff7e602 into main Jul 15, 2026
4 checks passed
@frankgiordano
frankgiordano deleted the jul14 branch July 15, 2026 03:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request Improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Refactor DsnRename into DsnUpdate to support dataset update operations

1 participant