As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm looking for some in depth end-to-end CQRS examples with a reasonable set of unit tests.
Also, if anyone knows of some CQRS screencasts as well it would be extremely handy.
I'm already aware of these examples
CQRS Info
Super Simple CQRS
There's a implementation here MarkNijhof.
But after reading the documents from the CQRS Info site my favourite resource is Think Before Coding look at the post Tags. (http://thinkbeforecoding.com/)
Some other useful resources...
http://distributedpodcast.com/
http://www.udidahan.com/
http://abdullin.com/
Microsoft patterns & practices is working on a guidance project called CQRS Journey. The idea is to develop a non-trivial system with multiple bounded contexts and apply CQRS, ES and other patterns & techniques where appropriate and document all lessons learnt along the way. The project is still in flight. Check out the journey progress at http://cqrsjourney.github.com
Code repo is at https://github.com/mspnp/cqrs-journey-code
Doc review via http://pundit.cloudapp.net
The project involves many community members and accepts contribitions!
http://ncqrs.org/
Is a useful resource...
Here is a complete example I wrote for my CQRS lib Scritchy:
Example.Domain: Domain implementation
Example.Specs : Domain behavior specs using MSpec
Example.Web : Example MVC web app (demo at http://scritchyExample.apphb.com )
Example.SignalR : Example html/Javascript/SignalR web app (using the same domain code)
Creating your CQRS app using the Scritchy nuget package is pretty straightforward and gets you up and running in a few minutes
Here's some more informational resources, but unfortunately no end-to-end code samples beyond SimpleCQRS and MarkNijhof.
http://seabites.wordpress.com/
http://richarddingwall.name/2010/06/15/brownfield-cqrs-part-1-commands/
http://www.agilification.com/post/CQRS-Series-from-Mark-Nijhof.aspx
http://jonathan-oliver.blogspot.com/
I have come across a couple other code samples, though I have not yet had time to review them whatsoever:
http://dddsamplenet.codeplex.com/
http://agrcqrs.codeplex.com/
Udi Dahan would have to be one of the experts in the CQRS field, imo.
Here is a blog about it: http://www.udidahan.com/2009/12/09/clarified-cqrs/
Here is a CQRS podcast (I haven't watched it, but if it's anything like his course presentation it will be great): http://skillsmatter.com/podcast/open-source-dot-net/udi-dahan-command-query-responsibility-segregation/rl-311
Here is a SOA talk (may not be directly relevant but excellent regardless): http://vimeo.com/5022174
If you have the time, I'd recommend popping along to one of Udi's courses when one is nearby, as he covers CQRS in depth.
I recommend this screencast by Chris Tavares. It gives a good overview of CQRS and it shows some good examples in code.
URL:
http://channel9.msdn.com/Blogs/MichaelLehman/PP-Symposium-2010-The-Commmand-Query-Separation-Pattern-Chris-Tavares
I've got a sample of just the BDD style of unit-tests, it isn't end-to-end, but since you mentioned unit tests I figured it might be of interest.
http://lucisferre.net/2011/02/05/behavior-driven-test-driven-domain-driven-design/
There was a great session during aspConf 2012 by Ashic Mahtab.
CQRS with ASP.NET MVC - A Year On
Complete source code here
Related
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I came across stateless, a hierarchical state machine framework based on Simple State Machine for Boo, but configured using C# 3.0
It is easy to configure and use, I will probably use it soon.
But I was just wondering if
Anyone used stateless for real projects (If so what is your opinion?)
Are there any other good workflow engines for .NET? (other than WF)
I've been using Stateless and WF for an app that is intended to go into production someday. :) I have detailed my experiences so far on my post here.
Overall, I prefer Stateless because it's simpler for more things that WF. Sure, it's nice to be able to design your workflow graphically, but when you need to implement something more difficult than a sequential workflow (like the state machine workflow), you'll need to work with ExternalDataExchange just to make the right state transitions. It's probably not hard, but considering that and the fact that you need to implement a persistence service to pause a workflow just seemed unappealing to me. I don't have a need to persist a workflow to disk for later execution anyway... so I will be using regular events to deal with this in Stateless. Error handling is easily doable in Stateless (I've been successful with it), but the implementation I've taken is questionable, and is the topic of another discussion (which I'm searching for now on SO!). I might be posting a question regarding this very soon.
Good luck with Stateless. I hope to hear how you've been progressing with it.
For Workflow Foundation, only use it for green project so you can use WF4. Check this out
http://realworldsa.dotnetdevelopersjournal.com/goodbyewindowsworkflowfoundationseeyouin2011.htm
WF 1.0 and 1.5 are not compatible with WF4. So it's not a forward solution.
I personally use http://simplestatemachine.codeplex.com as an alternative to WF. I have used it in one full production system (asp.net based) to handle a pretty complex business license issuance system (handling 350+ different government business licenses).
I haven't tried stateless yet but it looks promising.
Late to the party. We've used Stateless in production now for over a year and a half, no issues. It is a very elegant solution for processing workflows and you quickly integrate the states with your data model. We represent our states with and int in SQL, so you can run the state machine in ASP.Net in process. This is true for long running workflows as well.
If your requirements are basic, a very simple StateMachine I wrote may be of interest.
Please be warned that it does not (at the time of writing) support hierarchical states.
You can find it on NuGet:
nuget install nstate
or check it out on GitHub:
https://github.com/benaston/NState
I hope someone finds it useful.
If you haven't looked at the Windows Workflow Foundation it's probably at least worth doing a bit of reading about it.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am tired of tutorials that just enumerate the concepts with examples. How about some tutorials that show the wrong way of doing and then the correct way of doing things? It would be great to learn things like interfaces, delegates, abstract classes, singleton ...etc that way.
It would be great to read some clean code online as well but its hard to find...
any recommendations??
I develop in C# , .net , MS technologies...
I think the Head First books provide a really easy to read and learn from approach to learning the basics of software engineering. You can do Head First C#, then Head First Design Patterns and Head First Object Oriented Analysis and Design.
Then again, these books aren't free....
You might want to look for AppDev and/or Total Training e-learnings.
Meanwhile, there are some webcasts on Microsoft website that are very interesting. I learned MVC architecture that way.
Microsoft Events and Webcasts
http://www.dofactory.com/Patterns/Patterns.aspx covers all of the GOF patterns, with examples in C#.
http://www.oodesign.com/ is another great reference site. Also covers all of the GOF patterns, with code samples, and a more in-depth explanation of each. Also lists pros and cons of each pattern, and appropriate situations to use them.
Have you read Design Patterns: Elements of Reusable Object-Oriented Software by the "Gang of Four"?
That was the book which made me glad that I'd learned a programming language that supported object-oriented programming.
It doesn't show the wrong way to do things, but part of the "pattern description" are the "forces" or circumstances for which each pattern is a useful solution.
The code examples are small (but clean).
For me with C#, I'm always going back to Juval Lowey's Programming .NET Components.
Object-Oriented-Design-Heuristics is great and appropriate for your needs IMHO. Head First Design Patterns is wonderful also, with interesting examples of incorrect and correct practices for certain cases.
You might be able to find some good advice on programming techniques, but there's no wax-on-wax-off for coding skills. You learn by doing it. Mostly by doing it wrong a lot at first. I know it sucks, but it's the way it is.
Unfortunately I don't know if there's any such resource out there, but this sounds like a great idea for a website. Something like fmylife.com, but specifically for OOP where users post their real-life problematic object-oriented solutions that can be discussed and fixed very much like in SO. All questions and answers tagged with a specific design pattern would represent real examples for that pattern.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have some 5+ years' background in C++/Unix development. I have been trying my hand at C#/.Net/WPF based software development for some time now. I am at a stage where I can write functioning applications fluently, but am not sure how to take my skills to the next level.
So, my question(s) to you all, especially to those who are experienced in C#/.Net/WPF:
What are the component skills and knowledge that an expert developer on this platform should have?
What technology-specific books would you expect a would-be expert to have read?
What other deliberate steps can I take to become really good at application development using C#/.Net/WPF?
Many thanks in advance! I would be especially grateful for comprehensive answers - I'm pretty sure many other developers have similar questions.
Learn how the C# language and .NET runtime work by reading CLR via C#.
Scott Hanselman's article, "What Great .NET Developers Ought To Know", is a great resource on the subject.
My team has worked in C# for the past 5 years. Typically, experienced C++ programmers take a week or two to become fully functional in C#. I've even seen some do it almost instantly, after sitting with them one morning, showing them our code, and explaning the basics of the language that differ from C++. But that's not how I recommend you do it.
I recommend you do this:
Read a C# book: My pick would be Programming C# by Jesse Liberty. Important chapters are the language itself and the basics of the .NET framework libraries. The .NET Framework is huge, so you don't have to know everything in detail. You can skip through (or skim) the Windows Forms chapters. Windows Forms is so different from WPF that it won't be useful to you if you are planning on only doing WPF.
(source: amazon.com)
Read a WPF book: The best book I read so far is Windows Presentation Foundation Unleashed by Adam Nathan. WPF has a steep learning curve compared to Windows Forms, even for experienced C#/WinForms programmers. It has a lot of complex elements to understand like XAML, dependency properties, bindings, templates, animation, resources, etc. This book teaches you the basics gradually and is easy to read and understand. And it's in full color!
Read about the Model-View-ViewModel pattern: I haven't found a good book on that yet, but it's been very important for me to make my WPF applications more simple and manageable. My favorite material to learn about MVVM is this one hour presentation by Jason Dolinger. He builds a WPF application from scratch using no particular pattern, and step by step, migrates it to the MVVM pattern.
Also have a look at this past Stackoverflow question: Questions every .NET developer should be able to answer.
For WPF specifically (and the power of WPF binding) I like M-V-VM: http://karlshifflett.wordpress.com/
Make sure you learn how to use and leverage Dependency Injection / Inversion of Control in your applications. Other very important pieces of software to learn to include with your development is Microsoft Enterprise Library and Windows Communication Foundation. Those 2 tools offer an amazing amount of leverage to avoid having to recreate the wheel to solve problems.
Other really good packages to become familiar with are NHibernate and Fluent NHibernate.
Windows Workflow Foundation is a very powerful piece of software however the complexity level is high this would be another great addition to your knowledge base time permitting.
I would add unit testing, TDD, and mocking frameworks to your list of things to know.
I have "The Art of Unit Testing" and found it helpful.
I really like WPF in Action and Programming .NET Components is essential reading for any .NET developer.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What are some of the open source projects out there that you would hold up as shining examples of projects that correctly and effectively use enterprise sofware patterns and best practices such as Inversion of Control, Model-View-Controller, Unit Testing, etc.?
For purposes of this question the project should:
Include source code that illustrates the pattern in use, and
Be doing something important and useful, i.e. not using the pattern frivolously just because it is flavor of the week. Hence the words, "Correctly and Effectively" in the question
It should be software that you could show to the people who work for you and enthusiastically be able to say, "I want you to do it the way these guys did it."
Most of the GNU project is very very well written, over a very long period of time, with strict guidelines.
Prism is very good for MVVM in WPF and Silverlight
patterns they use Patterns in the Composite Application Library
An objective pick would be the Spring Batch project.
How did I pick it? Judging from the technical debt as seen on the Nemo Sonar instance, Spring Batch has the lowest debt/line ratio for projects larger than 10k lines of code.
When I first looked at the source code for DotNetBlogEngine, I was impressed at how well it was organized. And it didnt couple any of its components to the interface, making it extremely flexible.
It's not a terribly huge project either, not like trying to recompile your own linux kernal or something. So you can dive in quickly and have some fun with it.
Castle project
You can try this book - Beautiful Code
The author has collected some experience-sharing articles of open source projects. e.g. Python's Dictionary Implementation, Subversion's Delta Editor, etc.
You mean Spring? Or projects that use it?
UPDATE: WebWork, Guice, and Spring Security all fit the mold.
As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm trying to understand the concepts behind DDD, but I find it hard to understand just by reading books as they tend to discuss the topic in a rather abstract way. I would like to see some good implementations of DDD in code, preferably in C#.
Are there any good examples of projects practicing DDD in the open source world?
Eric Evans and a Swedish consulting company have released a sample application based on the shipping example that Eric uses throughout the book. It's in Java, but the concepts are well documented on the project page.
http://dddsample.sourceforge.net/
However, be warned that DDD is more about the journey than the destination. Understand that the sample code you are looking took many forms before it became what you see now. You did not see the awkward models that were used initially and you're missing the steps taken to refactor the model based on insight gained along the way. While the building blocks are important in DDD, Eric belives they are over-emphasized, so take all samples with a grain of salt.
I'm not sure how complete it is, but I found the NDDD Sample on Google Code.
I'm surprised no one mentioned Macto, Ayende's DDD sample. The most important thing about Macto is that the hole thinking process before the actual coding is presented in a series of posts. DDD is not about implementing a model, is about modeling a business domain. Decisions like "some concept is an Aggregate Root/Entity/Value Object" are far more important than how will an AR be persisted.
Also i would recommend Udi Dahan's videos about SOA and CQRS which might provide a better context on which to apply DDD.
This is not an open source project, but still it is an example in code: http://www.codeplex.com/dddpds
The example is used in the book .NET Domain-Driven Design with C#: Problem-Design-Solution
A made-up example that seems promising but might have died:
http://www.codeplex.com/domaindrivendesign
I'm afraid that http://www.codeplex.com/domaindrivendesign has indeed died, but if anyone is interested in contributing feel free to contact me.
Overall I would recommend against relying too much on examples of DDD, at best examples can show the results of the domain modelling and/or one approach for implementing the patterns. I would thus recommend reading the book and then asking questions at the forum.
http://kigg.codeplex.com/ is a good example for me.
I know it is not C#, but this is a java meta-framework that follows a domain driven approach: I don't know much about it but I'm willing to study it in the near future: Roma Framework
http://sellandbuy.codeplex.com/
another project DDD
A good read is Jimmi Nilssons book (and blog for that matter)
Applying domain driven design
It's a mixture of Evans and Fowlers books (Domain-Driven Design - Evans), and (Patterns of Enterprise Application Architecture - Fowler)
I haven't used any myself, but there are some tools mentioned on the DDD Wikipedia page. Most of them seem to be implemented in Java though.
http://en.wikipedia.org/wiki/Domain-driven_design#Software_tools_to_support_domain-driven_design
Ok, I found this, but it's Java not C#:
http://timeandmoney.domainlanguage.com/
Code Camp Server, Jeffrey Palermo's sample code for the book ASP.NET MVC in Action is open source and uses DDD.
(Same as my answer in Good Domain Driven Design samples)