dymosoftware / DCD-SDK-Sample

DYMO Connect SDK Samples
Other
60 stars 26 forks source link

Support semantic versioning #88

Open dotnetjunkie opened 7 months ago

dotnetjunkie commented 7 months ago

Compared to version 1.4.3, 1.4.4 introduced a major breaking change to the library; it changed the IDymoPrinter interface in a quite severe way. Its methods now returns a Task<T>. This can be problematic for applications that don't fully apply asynchronous programming, because code can easily deadlock when calling asynchronous methods synchronously (e.g. calling Task<T>.Result). But even for fully async applications this change is problematic, because it at the very least causes compile errors when upgrading.

Although I do understand that making the library more asynchronous is important for newly developed applications, the big problem to me is that this breaking change is introduced in a patch release. In general, NuGet packages are expected to follow semantic versioning rules, because this simplifies communication with users, as version numbers indicate the type of change that can be expected. With semantic versioning, breaking changes are only expected when the major version number changes; not when the minor version numbers changes, let alone when the patch number changes, as is the case in this instance.

My request therefore is: please consider embracing semantic versioning rules for the DYMO.Connect.SDK NuGet package. This prevents developers from accidentally updating packages to newer versions where no breaking changes are expected.

And about the IDymoPrinter interface, please consider adding async methods instead replacing non-async methods. e.g.:

public interface IDymoPrinter
{
    // Sync versions
    IEnumerable<IPrinter> GetPrinters();
    bool PrintLabel(...);
    bool PrintLabel(...);
    bool IsRollStatusSupported(...);
    IRollStatusInPrinter GetRollStatusInPrinter(...);

    // Async versions
    Task<IEnumerable<IPrinter>> GetPrintersAsync();
    Task<bool> PrintLabelAsync(...);
    Task<bool> PrintLabelAsync(...);
    Task<bool> IsRollStatusSupportedAsync(...);
    Task<IRollStatusInPrinter> GetRollStatusInPrinterAsync(...);
}