Skip to content

Commit

Permalink
Release 0.5.4
Browse files Browse the repository at this point in the history
  • Loading branch information
markrendle committed Mar 23, 2011
1 parent 360c960 commit deb2588
Show file tree
Hide file tree
Showing 15 changed files with 93 additions and 12 deletions.
4 changes: 2 additions & 2 deletions CommonAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,5 @@
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]

[assembly: AssemblyVersion("0.5.3.0")]
[assembly: AssemblyFileVersion("0.5.3.0")]
[assembly: AssemblyVersion("0.5.4.0")]
[assembly: AssemblyFileVersion("0.5.4.0")]
3 changes: 1 addition & 2 deletions NuGet/CopyReleases.cmd
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
copy /y ..\Simple.Data\bin\Release\Simple.Data.dll Simple.Data.Core\lib\net40
copy /y ..\Simple.Data.Ado\bin\Release\Simple.Data.Ado.dll Simple.Data.Core\lib\net40
copy /y ..\Simple.Data.Ado\bin\Release\Simple.Data.Ado.dll Simple.Data.Ado\lib\net40
copy /y ..\Simple.Data.SqlServer\bin\Release\Simple.Data.SqlServer.dll Simple.Data.SqlServer\lib\net40
copy /y ..\Simple.Data.SqlCe35\bin\Release\Simple.Data.SqlCe35.dll Simple.Data.SqlCompact35\lib\net40
copy /y ..\Simple.Data.SqlCe40\bin\Release\Simple.Data.SqlCe40.dll Simple.Data.SqlCompact40\lib\net40
copy /y ..\Simple.Data.Mocking\bin\Release\Simple.Data.Mocking.dll Simple.Data.Mocking\lib\net40
1 change: 1 addition & 0 deletions NuGet/NuGetPack.cmd
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
nuget pack Simple.Data.Core\Simple.Data.Core.nuspec
nuget pack Simple.Data.Ado\Simple.Data.Ado.nuspec
nuget pack Simple.Data.SqlServer\Simple.Data.SqlServer.nuspec
nuget pack Simple.Data.SqlCompact40\Simple.Data.SqlCompact40.nuspec
nuget pack Simple.Data.Mocking\Simple.Data.Mocking.nuspec
17 changes: 17 additions & 0 deletions NuGet/Simple.Data.Ado/Simple.Data.Ado.nuspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0"?>
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Simple.Data.Ado</id>
<version>0.5.4</version>
<authors>Mark Rendle</authors>
<owners>Mark Rendle</owners>
<description>ADO Adapter for the Simple.Data data access library.</description>
<projectUrl>http://github.com/markrendle/Simple.Data</projectUrl>
<licenseUrl>http://www.opensource.org/licenses/mit-license.php</licenseUrl>
<tags>sqlserver database data ado .net40</tags>
<language>en-us</language>
<dependencies>
<dependency id="Simple.Data.Core" version="0.5.4" />
</dependencies>
</metadata>
</package>
Binary file not shown.
Binary file not shown.
Binary file modified NuGet/Simple.Data.Core/lib/net40/Simple.Data.dll
Binary file not shown.
2 changes: 1 addition & 1 deletion NuGet/Simple.Data.Core/simple.data.core.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package>
<metadata>
<id>Simple.Data.Core</id>
<version>0.5.2</version>
<version>0.5.4</version>
<authors>Mark Rendle</authors>
<owners>Mark Rendle</owners>
<description>A Simple, Dynamic data access library.</description>
Expand Down
6 changes: 3 additions & 3 deletions NuGet/Simple.Data.Mocking/Simple.Data.Mocking.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Simple.Data.Mocking</id>
<version>0.5.2</version>
<version>0.5.4</version>
<authors>Mark Rendle</authors>
<owners>Mark Rendle</owners>
<description>XML-based Mocking adapter for the Simple.Data data access library.</description>
<projectUrl>http://github.com/markrendle/Simple.Data</projectUrl>
<licenseUrl>http://www.opensource.org/licenses/mit-license.php</licenseUrl>
<tags>sqlserver compact sqlce database data ado .net40</tags>
<tags>database data .net40</tags>
<language>en-us</language>
<dependencies>
<dependency id="Simple.Data.Core" version="0.5.2" />
<dependency id="Simple.Data.Ado" version="0.5.4" />
</dependencies>
</metadata>
</package>
Binary file modified NuGet/Simple.Data.Mocking/lib/net40/Simple.Data.Mocking.dll
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Simple.Data.SqlCompact40</id>
<version>0.5.2</version>
<version>0.5.4</version>
<authors>Mark Rendle</authors>
<owners>Mark Rendle</owners>
<description>SQL Server Compact 4.0 ADO provider for the Simple.Data data access library.</description>
Expand All @@ -11,7 +11,7 @@
<tags>sqlserver compact sqlce database data ado .net40</tags>
<language>en-us</language>
<dependencies>
<dependency id="Simple.Data.Core" version="0.5.2" />
<dependency id="Simple.Data.Ado" version="0.5.4" />
</dependencies>
</metadata>
</package>
Binary file modified NuGet/Simple.Data.SqlCompact40/lib/net40/Simple.Data.SqlCe40.dll
Binary file not shown.
4 changes: 2 additions & 2 deletions NuGet/Simple.Data.SqlServer/Simple.Data.SqlServer.nuspec
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<package xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<metadata xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd">
<id>Simple.Data.SqlServer</id>
<version>0.5.2</version>
<version>0.5.4</version>
<authors>Mark Rendle</authors>
<owners>Mark Rendle</owners>
<description>SQL Server ADO provider for the Simple.Data data access library.</description>
Expand All @@ -11,7 +11,7 @@
<tags>sqlserver database data ado .net40</tags>
<language>en-us</language>
<dependencies>
<dependency id="Simple.Data.Core" version="0.5.2" />
<dependency id="Simple.Data.Ado" version="0.5.4" />
</dependencies>
</metadata>
</package>
Binary file modified NuGet/Simple.Data.SqlServer/lib/net40/Simple.Data.SqlServer.dll
Binary file not shown.
64 changes: 64 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Fix
An ultra-lightweight web glue for .NET, written in C#.
## What?
Fix joins together web servers, request handlers and "infixes", or middleware, in such a way that the implementations of each don't need to know anything about each other, or, indeed, about Fix itself.
### Example?
This is a Console application which runs a web server using Fix:

class Program
{
static void Main()
{
using (var server = new Server("http://*:81/"))
{
var fixer = new Fixer(server.Start, server.Stop);
fixer.AddHandler(new RequestPrinter().PrintRequest);
fixer.Start();
Console.Write("Running. Press Enter to stop.");
Console.ReadLine();
fixer.Stop();
}
}
}
Fixer, Server and RequestPrinter are all in separate assemblies, with no dependencies between them. The Console application has references to all the assemblies, and uses Fix to hook everything up.
### More example?
class Program
{
static void Main()
{
using (var server = new Server("http://*:81/"))
{
var fixer = new Fixer(server.Start, server.Stop);
fixer.AddHandler(new RequestPrinter().PrintRequest);
fixer.AddHandler(new InfoPrinter().PrintInfo);
fixer.AddInfix(new MethodDownshifter().DownshiftMethod);
fixer.Start();
Console.Write("Running. Press Enter to stop.");
Console.ReadLine();
fixer.Stop();
}
}
}
In this case, we are adding two handlers, either of which could serve the request. We're also adding an Infix, which can modify the request before it is passed to the handlers.
##Why?
Partly because it's interesting to boil something like a web application server down to the bare minimum like this.

More importantly, by relying entirely on .NET standard Action and Func delegates, Fix eliminates unnecessary coupling between classes and assemblies, as well as dependencies on itself.
So you could write your own Fixer class and use that to wire up any servers, handlers or modules that would work with this "reference implementation".

Another benefit is that because Fix takes a functional approach to the problem, it is friendlier to functional languages like F# and Clojure.
And functional languages are ideal for writing web applications, which aren't supposed to maintain any state anyway.
Ideally, a request will come in and be turned into a response by a series of operations.

###Action and Func, eh?
Yes, and the actual signatures are hideous. What I've done in this code is to add "using" aliases for them, to make it easier to read:

using RequestHandler = System.Action<string, string, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, byte[], System.Action<int, string, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, byte[]>>;
using ResponseHandler = System.Action<int, string, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, byte[]>;
using Infix = System.Action<string, string, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, byte[], System.Action<int, string, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string, string>>, byte[]>, System.Delegate>;
##Production-ready?
Good grief, no. There's a lot of discussion going on around this area at the moment (e.g. [the OWIN project](http://owin.github.com/owin))
and this is my contribution. The delegate signatures used are by no means ideal, particularly the *byte[]* type being used for the request
and response bodies, which should probably be a *Func of byte[]* or a *Task of byte[]* or something.

I'd love to hear people's thoughts on this. Best way is to catch me on [Twitter](http://twitter.com/markrendle).

0 comments on commit deb2588

Please sign in to comment.