Thoughts from the Wet Coast

The musings of an ASP.NET Developer from Canada's We(s)t Coast

Project Naif - 1: An Introduction

Category: Development Patterns
Last Modified: May 2 2017
Jul 14 2014

(adj) naif, naïve  -- marked by unaffected simplicity

- Merriam Webster

I have been working for a while on a library of simple components, which I have called Project “Naif”.  Naif is the masculine form of the more common adjective “naïve”.   Both words are originally French and while naïve is in fairly common usage in English, naif is much less used.  But they mean the same thing – marked by unaffected simplicity - as defined by Merriam Webster.

There are two major reasons for this project. 

Firstly, as I have been doing quite a bit of development on Windows Phone “Mango” I have realized that some of the more sophisticated frameworks do not work on the reduced “Client Profile” that Windows Phone supports, and I needed something lightweight that would accomplish these tasks. 

Secondly, I saw this as a challenge – a way to learn some new concepts and techniques.

This Project is a living project - as I need a component I will build one, but at the time of writing – my little library has the following components:

  • A simple lock based on the Monitor object
  • Thread safe collections – SynchronizedDictionary and SynchronizedList
  • A simple DI (dependency injection) container
  • A cache provider model with two simple implementations – one based on the ASP.NET runtime cache and one based on a simple Dictionary
  • A simple data framework which supports Unit of Work, the Repository pattern, caching and transactions
  • An oAuth 2 Client

For most of these components there are some quite well-known open source projects available – many of them though can be quite complex, and as stated above, my goal is to be as simple as possible. 

Inspired by some of the recent micro-ORMs (Dapper, Massive and Peta-Poco) – many of these components are single classes and all of the components mentioned above are compiled into a single assembly which is currently about 35-40K in size.  They may not work in every scenario, but they certainly provide a robust set of tools for my Windows Phone development.

So in this series, I am going to describe many of these components, and why I made some of the design choices.

Disclaimer

The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

Categories

Tags