14

I recently saw a new pattern (new to me) in an open source ASP.NET MVC 3 project that hase many Command, CommandHandler, and CommandInvoker -with their interfaces- and I can't understand the pattern! Can you tell me what is this pattern's name and where can I learn about it? And what is its benefits please? Thanks in advance.

Update: I'm talking about this project:

An image gallery with RavenDB

3

2 Answers 2

16

Take a look at this article: Meanwhile… on the command side of my architecture

It contains a thorough explanation about why you want to use commands and command handlers as part of your architecture. An architectural pattern such as CQRS is based on commands and events, but even without applying CQRS, the use of commands in your architecture is very valuable, as the article explains.

The RavenGallery project, however, is too small to really see the benefits of this command/handler model. This model starts to shine when a project gets bigger.

A more thorough discussion on this topic can be found in chapter 10 of my book.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks to update. Can you suggest some open source projects that are using command/handler?
In 2015, that reference project was moved to Github and can be found here: github.com/dotnetjunkie/solidservices. The codeplex link does not work any longer as Microsoft pulled the plug on codeplex.com.
0

To continue the thought by Steven, the command, handler, invoke pattern provides the ability to invoke commands, a SOLID object at a time, that can be called directly from the UI or other top layer that a user or service may interact with directly.

I believe it's goal is to reduce complexity normally found in N-Tier applications where there are multiple layers (i.e. Service Layer, DataAcces Layer) required to invoke commands (i.e. save an object to a database).

Out of the many "flavors" of the architecture out there, here's my take: https://github.com/mrogunlana/command-handler-pattern

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.