Skip to content

Instantly share code, notes, and snippets.

@ToJans
ToJans / CommandHandler.cs
Created September 21, 2010 15:36
preview of refactoring for simplecqrs
using System;
using System.Collections;
using SimpleCQRS2.Example.Domain;
using SimpleCQRS2.Example.Messages;
namespace SimpleCQRS2.Example.Handlers
{
public class CommandHandler
{
SomeReadModelUpdater sru;
public class TaskWorkflow : AggregateRoot
{
private Dictionary<Guid,ManualTask> Tasks = new Dictionary<Guid,ManualTask>();
public void InitiateTaskWorkflow(Guid taskWorkflowId, Guid associatedChangeRequest, string createdBy);
public void CreateTask(Guid taskIdentifier, string title,string description, DateTime plannedStartDate, DateTime
plannedEndDate, string assignedUser, string assignedGroup, string
createBy, WorkflowStage requiredCompletionStage);
public void RejectTaskOwnerShip(long taskId, string rejectedBy)
;
// POC CQRS bus for stateless synchronous commandhandlers
// and both both syncronous and asynchronous stateless eventhandlers
// Remarks : ToJans@twitter
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Threading;
@ToJans
ToJans / CQRSAndBDDTogether.cs
Created November 24, 2010 16:49
Another attempt to combine cqrs and BDD
// another attempt to combine CQRS with BDD
// tojans@twitter
using System;
using System.Linq;
using System.Collections;
using System.Collections.Generic;
#region Domain commands
@ToJans
ToJans / SoWhat.cs
Created December 1, 2010 11:34
SoWhat.cs - An example of a possible .Net web framework looking like Sinatra
// SoWhat.cs - An example of a possible .Net web framework looking like Sinatra
// tojans@twitter
using System;
using System.Collections.Generic;
public class ContactController
{
public class Contact
{
public string Name;
@ToJans
ToJans / AbsoluteminimumCQRS.cs
Created December 7, 2010 10:11
Testing whether one can remove CQRS infrastructure while keeping it usable/maintainable:
// an example minimalistic approach to CQRS/BDD
// Tojans@twitter
// Me need a macro to convert a function call to a Command IMHO
using System;
using System.Collections.Generic;
using System.Linq;
#region "Old code: ordinary interface"
@ToJans
ToJans / 0.cs
Created December 16, 2010 12:01
Another CQRS approach, a little verbose, but very safe to use
namespace AnotherInterfaceForCQRS
{
public interface IConsume<TChange>
{
void Consume(TChange change);
}
public interface IRun<THandler,TCommand>
{
void Run(THandler handler,TCommand command);
@ToJans
ToJans / Main.cs
Created January 14, 2011 13:13
stukske relevante code
void UpdateWifiAndTime(object par)
{
// Logger.WriteLine(()=>"Begin update wifi and time");
while (true)
{
try {
var store = par as VMStore;
var s = DateTime.Now.ToShortTimeString();
@ToJans
ToJans / error.txt
Created February 3, 2011 16:13
What am i doing wrong here ?
ReferenceError: session is not defined
at Object.<anonymous> (eval at <anonymous> (/usr/local/lib/node/.npm/coffeekup/0.2.2/package/lib/coffeekup.js:186:12))
at anonymous (eval at <anonymous> (/usr/local/lib/node/.npm/coffeekup/0.2.2/package/lib/coffeekup.js:186:12))
at Object.render (/usr/local/lib/node/.npm/coffeekup/0.2.2/package/lib/coffeekup.js:206:12)
at Object.render (/usr/local/lib/node/.npm/zappa/0.1.4/package/lib/zappa.coffee:472:26)
at Object.<anonymous> (eval at <anonymous> (/usr/local/lib/node/.npm/zappa/0.1.4/package/lib/zappa.coffee:626:12))
at RequestHandler.anonymous [as handler] (eval at <anonymous> (/usr/local/lib/node/.npm/zappa/0.1.4/package/lib/zappa.coffee:626:12))
at RequestHandler.execute (/usr/local/lib/node/.npm/zappa/0.1.4/package/lib/zappa.coffee:443:21)
at Object.<anonymous> (/usr/local/lib/node/.npm/zappa/0.1.4/package/lib/zappa.coffee:250:26)
at param (/usr/local/lib/node/.npm/connect/0.5.6/package/lib/connect/middleware/router.js:147:21)
public interface IUpdaterUI
{
string Message {set;}
int Progress {set;}
bool AllowContinue {set;}
bool AllowCancel {set;}
void Close();
}