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

Inconsistency in the use of classes and interfaces #539

Open
iskandersierra opened this issue Jul 3, 2024 · 2 comments
Open

Inconsistency in the use of classes and interfaces #539

iskandersierra opened this issue Jul 3, 2024 · 2 comments
Assignees
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@iskandersierra
Copy link

Observed behavior

To use just two instances as examples:

  1. At class NatsJSContext, methods CreateStreamAsync and UpdateStreamAsync return different types:

    public async ValueTask<INatsJSStream> CreateStreamAsync(...)
    {
        // ...
        return new NatsJSStream(...);
    }
    
    public async ValueTask<NatsJSStream> UpdateStreamAsync(...)
    {
        // ...
        return new NatsJSStream(...);
    }
  2. Contructor of class NatsJSContext receives a NatsConnection instead of INatsConnection:

    public partial class NatsJSContext
    {
    	public NatsJSContext(NatsConnection connection) ...
    	public NatsJSContext(NatsConnection connection, NatsJSOpts opts) ...
    }

Expected behavior

Given that the team decided to use interface + class pairs for most of the concepts, I would expect that there were no parameters and return types declared with the class type, but most importantly, that there were consistency among the declarations.

Server and client version

Client Versions:

<PackageReference Include="NATS.Client.JetStream" Version="2.3.0" />
<PackageReference Include="NATS.Client.Serializers.Json" Version="2.3.0" />
<PackageReference Include="NATS.Net" Version="2.3.0" />

Server Version: irrelevant

Host environment

No response

Steps to reproduce

No response

@mtmk
Copy link
Collaborator

mtmk commented Jul 3, 2024

thank you @iskandersierra we need to fix these. see also:

@mtmk mtmk added good first issue Good for newcomers help wanted Extra attention is needed labels Oct 28, 2024
@writesundar
Copy link

@mtmk could you assign this issue to me , i am new to Nats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants