C# - Multiple Configuration Sources for Enterprise Library 4.1. Microsoft Enterprise Library for .NET 2.0: Configuration. Microsoft Enterprise Library for .NET 2.0: Configuration.
Patterns & practices – Enterprise Library. Patterns & practices – Enterprise Library - Download: Enterprise Library 5.0 - SQL Configuration Source. Microsoft Enterprise Library: Data Access Application Block. For those of you who have been using the Enterprise Library from Microsoft then I tip my hat to you.
I admit that I have not used this library for a number of years and in most cases the reason is because I have honestly not been in a position to do so. It is a long story so don’t ask. There are a number of reason why you should seriously consider the use of the Enterprise Library and I cannot think of any better reason than those provided directly from Microsoft. The goals of Enterprise Library are the following: Consistency. REST - Can You do More than Spell It? Part 1. Thousands of years ago when we first started building web pages, things were very simple.
You’d put some text on the page, maybe even an image, and that was pretty much it. Entity Framework Repository Pattern. Non-Recursive Post Order Depth First Traversal in C# - RemLog. I was looking around for a non-recursive post-order traversal algorithm and it turned out to be more complex than I thought which surprised me.
I mean a recursive post order depth first traversal is so simple. static void recursivePostOrder(Node node) { foreach (var n in node.Children) { recursivePostOrder(n); } // Do action Console.WriteLine(node.Id); } static void preOrder(Node root) { Stack<Node> s = new Stack<Node>(); s.Push(root); while (s.Count > 0) { var n = s.Pop(); // Do Action Console.Write(n.Id); foreach (var child in n.Children.ToArray().Reverse()) { s.Push(child); } } } private static void nonRecursivePostOrder(Node root) { var toVisit = new Stack<Node>(); var visitedAncestors = new Stack<Node>(); toVisit.Push(root); while (toVisit.Count > 0) { var node = toVisit.Peek(); if (node.Children.Count > 0) { // PeekOrDefault is an extension helper, see full program below if (visitedAncestors.PeekOrDefault() ! We Are Not Doing DDD – Part Two - CQS - Jak Charlton - Insane World. From the beginning of my current project we have been working under some horrible constraints, many imposed by legacy systems, many by late decisions that would have speeded things immensely if made earlier, and many imposed by decisions that are outside of my control.
This lead us early on to make decisions on architecture that eliminated any possibility of using DDD heavily, and as I mentioned in my original post about this project it is also essentially a glorified CRUD system - we read data from databases, we modify it a bit, and we put it back again. What We Are Doing – Command Query Separation The first architectural choice that I made, and in hindsight got accepted with relative ease, was to employ CQS to simplify the system.
Nhibernate - How is Command Query Separation (CQS) implemented when using an ORM. Strengthening your domain: Avoiding setters. Previous posts in this series: As we start to move our domain model from an anemic existence towards one with richer behavior, we start to see the aggregate root boundary become very well defined.
Instead of throwing a bunch of data at an entity, we start interacting with it, issuing commands through closed, well-defined operations. The surface of our domain model becomes shaped by the actual operations available in our application, instead of exposing a dumb data object that lets anyone do anything, and consistency and validity are a pipe dream. With more and more of a behavioral model in place, something begins to look out of place. QCon San Francisco 2008 – Unleash Your Domain. The talk "Unshackle Your Domain" given by Greg Young was the highlight of QCon for me.
An architectural approach that is relatively easy to understand, incredibly scalable, and supports a rich domain model. At his presentation, Greg quickly pointed out some of the problems with traditional enterprise application architecture, such as JEE. This architecture usually consists of an "object-oriented" domain model encapsulated inside a procedural service layer, persisted in a relational database, flattened out on a data entry screen by the UI layer, and crunched daily into management reports by some reporting tool.
Command Query Separation. Does this sound familiar to you?
From time to time someone delivers you answers to questions that have been on your mind for quite a while. You didn’t find an answer on your own and most of the people you talked with either didn’t care or hadn’t satisfying answers for you. When you finally hear the answers you were searching for, you’re … stunned how simple the actual solution is,wondering why you weren’t able to solve that on your own,nevertheless happy and thankful to finally see the missing piece in your puzzle. The repository pattern explained and implemented.
The pattern documented and named “Repository” is one of the most misunderstood and misused.
In this post we’ll implement the pattern in C# to achieve this simple line of code: var customers = customers.Matching(new PremiumCustomersFilter()) as well as discuss the origins of the pattern and the original definitions to clear out some of the misrepresentations. The formal description. Employing the Domain Model Pattern. Domain Models Employing the Domain Model Pattern.
A response to Validation in a DDD world. Jimmy Bogard presented a well written argument for always keeping validation out of entities in a domain driven design except in "the absolute worst case. " But, IMO, there is simply no black and white verdict on where validation must live in a DDD application and must be carefully considered at the beginning of any project, taking into consideration the motivations behind validation, the scope of the project, the maturity of the development team, and the balance between philosophical purity and practical maintainability.
There are two clear project scenarios which come to mind when I try to answer where validation should live. The first is wherein a DTO layer is used to transfer information between the view and domain layers. For example, you may have a Customer object in your domain layer and an associated Customer DTO in another layer to which you map the Customer information, to then give to the view for presenting Customer information to the user.