In DDD/CQRS, A saga is a “long-lived business transaction or process between aggregates”, also call process manager
http://blog.jonathanoliver.com/cqrs-sagas-with-event-sourcing-part-i-of-ii/
http://blog.jonathanoliver.com/cqrs-sagas-with-event-sourcing-part-ii-of-ii/
How to unit test saga
http://www.udidahan.com/2008/02/04/sagas-and-unit-testing-business-process-verification-made-easy/
http://docs.particular.net/nservicebus/sagas/
Monday, March 30, 2015
Friday, March 27, 2015
How much code coverage do you really need?
http://software-development-thoughts.blogspot.ca/2011/04/how-much-code-coverage-do-you-really.html
Two quotes from Uncle Bob
“Two things. Repeatability and cost. Manual tests are horrifically expensive compared to automated tests.”
“Manual tests aren't tests; they are trials. And since there are humans involved, they are suspect."
Thursday, March 26, 2015
Tuesday, March 24, 2015
Last line effect
We expose the “last line effect,” the phenomenon that the last line or statement in a micro-clone is much more likely to contain an error than the previous lines or statements. We do this by analyzing 208 open source projects and reporting on 202 faulty micro-clones.
x += o t h e r . x ;
y += o t h e r . y ;
z += o t h e r . y ;
http://www.st.ewi.tudelft.nl/~mbeller/publications/2015_beller_zaidman_karpov_the_last_line_effect_preprint.pdf
x += o t h e r . x ;
y += o t h e r . y ;
z += o t h e r . y ;
http://www.st.ewi.tudelft.nl/~mbeller/publications/2015_beller_zaidman_karpov_the_last_line_effect_preprint.pdf
Thursday, March 19, 2015
About Command Idempotency
Definition from Gregor (New ACID)
“In the world of distributed systems, idempotency translates to the fact that an operation can be invoked repeatedly without changing the result.”
http://www.eaipatterns.com/ramblings/68_acid.html
http://codebetter.com/gregyoung/2010/08/12/idempotency-vs-distibuted-transactions/
Idempotency Patterns
http://blog.jonathanoliver.com/idempotency-patterns/
“In the world of distributed systems, idempotency translates to the fact that an operation can be invoked repeatedly without changing the result.”
http://www.eaipatterns.com/ramblings/68_acid.html
http://codebetter.com/gregyoung/2010/08/12/idempotency-vs-distibuted-transactions/
Idempotency Patterns
http://blog.jonathanoliver.com/idempotency-patterns/
Monday, March 16, 2015
What is the exact meaning of "Single" in Single responsibility principle
http://sklivvz.com/posts/i-dont-love-the-single-responsibility-principle
I don't love the single responsibility principle
I don't love the single responsibility principle
Tuesday, March 10, 2015
What is Event-driven architecture?
Behind Event-driven architecture, system model is treated as a state machine. After a command changed the state, an event is generated to notify other components.
http://c2.com/cgi/wiki?EventDrivenArchitecture
What is a simple explanation of higher order functions and callbacks in JavaScript?
http://www.quora.com/What-is-a-simple-explanation-of-higher-order-functions-and-callbacks-in-JavaScript
var animals = [
{ name: 'Waffles', type: 'dog', age: 12 },
{ name: 'Fluffy', type: 'cat', age: 14 },
{ name: 'Spelunky', type: 'dog', age: 4 },
{ name: 'Hank', type: 'dog', age: 11 },
];
var oldDogs = animals.filter(function(animal) {
return animal.age > 10 && animal.type === 'dog';
});
Friday, March 6, 2015
What is category in Event Store?
If put dash into stream name, the first part will be saved as category name
Source code from Event Store
_handler = new CategorizeEventsByStreamPath("-", Console.WriteLine);
public override string GetCategoryByStreamId(string streamId)
{
string category = null;
if (!streamId.StartsWith("$"))
{
var lastSeparatorPosition = streamId.IndexOf(_separator);
if (lastSeparatorPosition > 0)
category = streamId.Substring(0, lastSeparatorPosition);
}
return category;
}
http://codeofrob.com/entries/creating-a-projection-per-stream-in-the-eventstore.html
Source code from Event Store
_handler = new CategorizeEventsByStreamPath("-", Console.WriteLine);
public override string GetCategoryByStreamId(string streamId)
{
string category = null;
if (!streamId.StartsWith("$"))
{
var lastSeparatorPosition = streamId.IndexOf(_separator);
if (lastSeparatorPosition > 0)
category = streamId.Substring(0, lastSeparatorPosition);
}
return category;
}
http://codeofrob.com/entries/creating-a-projection-per-stream-in-the-eventstore.html
How to add Multiple Regular Expression Validation attribute into one Property in ASP.Net MVC?
Create another new attribute and inherit from RegularExpressionAttribute
public class RegularExpressionAttribute : ValidationAttribute
{
private string _pattern;
public RegularExpressionAttribute(string pattern)
{
_pattern = pattern;
}
protected override ValidationResult IsValid(object value, ValidationContext validationContext)
{
if (value == null) return null;
if (!System.Text.RegularExpressions.Regex.IsMatch(value.ToString(), _pattern))
{
return new ValidationResult(FormatErrorMessage(validationContext.DisplayName));
}
return null;
}
public class RegularExpression2ndAttribute : RegularExpressionAttribute {}
So in view model:
[ValidURL(ErrorMessage = "Invalid URL")]
[RegularExpression(@"^.*\.(jpg|JPG|gif|GIF|jpeg)$", ErrorMessage = "Not a image URL")]
public string LogoUrl { get; set; }
Thursday, March 5, 2015
Subscribe to:
Posts (Atom)