Announcing dotNetTips.com Spargine

 
I am happy to announce my new open-source assemblies and Nuget packages for .NET 5 called Spargine! I’ve been working hard for close to 6 months to move code from my .NET Framework and .NET Core assemblies into these new projects. While I still have a lot more code to move, the core code and assemblies are done along with a lot more unit tests and benchmark tests! Just moving to .NET 5 has increased the performance of most of the code too!
These assemblies contain the common code I have been writing ever since .NET 2! Not only do I use these assemblies in all my projects, but it is currently in production at the current company that I work for.
 

Assemblies

 
Below is the list of the assemblies that are being released today (more to come) and descriptions.
 
dotNetTips.com Spargine
 

dotNetTips.Spargine.Core

 
This assembly contains code that is used by all the other assemblies. Just some of the of what is contained are:
  1. Application information
  2. Common collection types
  3. Computer information
  4. Custom Exceptions
  5. Exception thrower
  6. Logging
  7. Serialization: XML and JSON!
  8. Validator (Formerly Encapsulation): Validates method parameters and other validations.
  9. Web: ServiceProxy and Web helper methods

dotNetTips.Spargine.Extensions

 
This assembly contains all the extension methods used by the assemblies. Over 39 classes so far! Here are some of the highlights,
  1. Collections: Array, Collection, Dictionary, Enumerable, HashSet, ImmutableArray, List, ObservableCollection, SortedDictionary, SortedSet
  2. DataContext
  3. DataReader
  4. DirectoryInfo
  5. Enum
  6. Exceptions
  7. LINQ
  8. Numeric
  9. Object
  10. String
  11. StringBuilder
  12. Task
  13. Thread
  14. Type
  15. WebClient

dotNetTips.Spargine

 
This assembly contains more higher-level code and/ or specific to Windows. I will be adding a lot more to this assembly, but this is what it contains so far:
  1. InMemoryCache
  2. Collections: ConcurrentHashSet, DistinceConcurrentBag, FastSortedList, ObservableList, CollectionRandomizer and DistinctBlockingCollection
  3. HttpClientHelper
  4. SocketsHelper

dotNetTips.Spargine.Tester

 
This assembly was converted from dotNetTips.Utility.Core.Tester for use in unit tests and benchmarking tests. The main class in this assembly is called RandomData that helps generate random data. Along with that, new types using the new record class types in .NET 5 along with methods to generate the data.
 
I have written about this assembly in this article.
 
I use this assembly in ALL my unit tests and benchmark tests!
 

dotNetTips.Spargine.Benchmarking

 
Since I now have many benchmarking test projects using BenchMarkDotnet, I decided to move the common code for these projects into this new assembly. The main classes are:
  1. Benchmark: Base class for all benchmark tests. This contains common info and sets a default configuration using attributes. For example, I configure all the export formats here and ordering.
  2. CounterBenchmark: This class features a counter used in most of the benchmark tests that allows the tests to run with multiple collection counts used to generate data. This class also pre-creates many of the collections used in testing.
  3. CollectionBenchmark: Class used for all the benchmark tests for collection types.
Now when I need to create a new benchmarking project and classes, this assembly makes it very easy and consistent!
 

Unit Testing

 
I wanted to release these assemblies in January, then February but had to wait until now due to all the unit tests I have been writing or re-working. I wanted to have 75% coverage or better but am currently at 53%. I will continue to strive for 100% coverage for the new code while I fill in the rest.
 
If you would like to help with writing unit tests, please email me at [email protected]. Not only will you get your name listed as a contributor, which could help with job interviews, then I will send you dotNetTips.com swag! If you live in the United States, I will send you one of my books too (as supplies last).
 
One thing I have really, really wished worked for .NET 5 is IntelliTests since I could have had this work done a long time ago. If you want IntelliTests back in .NET 5, please vote by going here.
 

Breaking Changes

 
Since I moved all the previous code to .NET 5, I decided to move a lot of the code into assemblies that make more sense and discoverable (except for extensions) along with changing method names and even parameters. Along with this, I have taken the time to write better documentation including sample code!
 
Due to this, if you used one of my older assemblies, you might run into breaking changes. I have tried to keep these to a minimum and in all the code I have had to change so far, most can be fixed with a simple search and replace.
 
If you run into major issues or cannot find something, please email me at [email protected].
 

Looking for Contributors!

 
Do you have common code that you have written that you would like to contribute to this project? I am always looking for this type of code, so please download the source, make your improvements, and then submit a pull request!
 
If I accept it (make sure you follow the coding standards in my book), I will send you dotNetTips.com swag and if you live in the U.S., one of my books (while supplies last). I have a lot of swag sitting in my home due to not speaking in person for over a year!
 
To contribute, go to here.
 

Summary

 
I hope you will check out these assemblies. Stay tuned to this site for upcoming quarterly releases! If you have any comments or suggestions, please comment below. I am always looking for new ideas for these open-source projects!


McCarter Consulting
Software architecture, code & app performance, code quality, Microsoft .NET & mentoring. Available!