Code Monkey home page Code Monkey logo

specivacation's Introduction

MyGet Build Status

SpeciVacation

Because the specification pattern is a pretty helpful tool in the struggle to keep code bases maintainable.

Installation

Package is available on NuGet.

dotnet add package SpeciVacation

or

Install-Package SpeciVacation

But why?

Composing specifications should be easy and just work no matter the database technology. This requires some work with the underlying C# Expression.

I am not a smart man, and working with Expressions feels to me like building a sandcastle with dry sand. There are many guides and good ideas on stackoverflow and elsewhere, that look like they should work, but then they don't. This is where LINQKit comes into the picture and alleviates all the Expression-headaches. It's built for Entity Framework but also seems to just work with the MongoDB drivers.

Granted, other implementations of the specification pattern already exist. However:

I feel the "new way" of NSpecifications a step in the wrong direction for maintainability because it's use of a generic specification implementation.

SpecificationPattern (another open source piece of code) is only implemented through an abstract class, and I've had use cases where I like having the interface available to encapsulate the same business rule for multiple entity types. More importantly the way expressions are composed just don't work with MongoDB, which I use extensively. This is where LINQKit comes into the picture. Now my only problem is which operations are supported by the Mongo driver :-x

The name

The name NuGet package id Specification was already in use and I found it pretty punny because I was on vacation when I set up the repository and the MyGet CI.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.