Naming conventions for custom view NuGet package

TakajiMesserTakajiMesser USMember

I have a custom view for Android in Xamarin that I am planning on releasing. The custom view and the accompanying sample project are complete. My last step is to name everything correctly, and I wanted to clarify/learn if there are some standards and guidelines to help me do this, as I'm getting pretty mixed up with everything. I'm also struggling with avoiding any naming conflicts, especially between namespaces and classes, while still ensuring that any future custom views I release can have a different assembly name.

I have a Visual Studio solution that contains two projects, one being the library and the other being the sample implementation. I'll just refer to the view as "CustomView" here:

CustomView Project

  1. Project Name (CustomView?)
  2. Assembly Name (MS recommends Company.Component)
  3. Default Namespace (MS recommends Company.Technology.Feature)
  4. Registered Name (Should begin with com?)

Sample Project

  1. Project Name (Sample?)
  2. Assembly Name
  3. Default Namespace

Miscellaneous

  1. Solution Name
  2. GitHub Repository Name
  3. NuGet Title
  4. NuGet ID (MS seems to recommend MyCompanyName.MyProductName.MyPackageName)

Posts

  • tuyenvtuyenv VNUniversity ✭✭✭

    That's the matter of preference, I think.

    I normally name my company control library

    • package: [Company].[Control/Product].[TargetedPlatform]
    • default ns: [Company].Controls.[TargetedPlatform]

    For example, I am doing a CarouselView control for Xamarin.Forms, then I will have

    • package: Naxam.CarouselView.Forms
    • default ns: Naxam.Controls.Forms
      - platform specific renderer, I follow Xamarin way: Naxam.Controls.Platform.Droid/Naxam.Controls.Platform.iOS

    Another one, I am doing a CarouselView control for Xamarin.Android, then I will have

    • package: Naxam.CarouselView.Droid
    • default ns: Naxam.Controls.Droid

    Hope it will help you somehow :).

Sign In or Register to comment.