Aug 31 2010

CQRS Overview - Series Introduction

Category: Software DevelopmentJeff @ 14:35

Command Query Responsibility Segregation (CQRS) has attracted a lot of attention recently.  This post kicks off a series of blog posts that will describe my experiences learning CQRS, including potential benefits and possible pitfalls.

In order to determine the potential of this approach, I have adopted CQRS for an in-house development project.  I do not currently have any production code that uses this pattern extensively, though I have long been a proponent of Domain Driven Design (DDD) and Agile programming practices.  I plan to use the lessons learned to guide future decisions about whether to fully adopt CQRS, implement portions of it, derive concepts from it, or run the other way screaming.  :)

I look forward to your questions, comments, suggestions and critical feedback. It should be a wild ride.

Tags: , ,

Aug 30 2010

CQRS Series from Mark Nijhof

Category: Software DevelopmentJeff @ 17:27

 

Learning CQRS?  A while back, Mark Nijhof posted a helpful series of blog posts along with an example project.  It's a great place to start for understanding the concepts and implementation details of Command Query Responsbility Separation.  If you've been on the CQRS bandwagon for a while, this is old news for you.  But for more recent adopters, you'll find this to be a helpful introduction.

 

Code Sample - http://github.com/MarkNijhof/Fohjin

Video Walkthrough of the Code Sample - http://vimeo.com/7838858

 

CQRS à la Greg Young - http://cre8ivethought.com/blog/2009/11/12/cqrs--la-greg-young/

CQRS Domain Events - http://cre8ivethought.com/blog/2009/11/20/cqrs-domain-events/

CQRS Domain State - http://cre8ivethought.com/blog/2009/12/08/cqrs-domain-state/

Specifications - http://cre8ivethought.com/blog/2009/12/22/specifications/

CQRS Event Sourcing - http://cre8ivethought.com/blog/2010/02/05/cqrs-event-sourcing/

CQRS Event Versioning - http://cre8ivethought.com/blog/2010/02/09/cqrs-event-versioning/

CQRS Scalability - http://cre8ivethought.com/blog/2010/02/09/cqrs-scalability/

Using conventions with Passive View - http://cre8ivethought.com/blog/2009/12/19/using-conventions-with-passive-view/

 

 

Tags: , , ,

Aug 25 2010

Greg Young on DDD and CQRS

Category: Software DevelopmentJeff @ 18:50

I spent last Saturday participating in Greg Young's DDD/CQRS weekend.  Greg provided a helpful, all-day-long overview of Domain Driven Design, Command Query Responsibility Segregation and the ways these concepts can be applied to an existing architecture or greenfield project.

I took 17 pages of notes throughout the day which you are free to download [CQRS DDD Notes Greg Young.pdf (449.24 kb)].

For more information about DDD and CQRS, check out the DDD/CQRS Google Group.

 

Tags: , , ,

Aug 23 2010

Half a Billion Dollar School Opening in LA

Category: Agile EverywhereJeff @ 22:25

LA unveils $578M school, costliest in the nation

Teachers barely make enough to subsist, unions make a ton of money on dues, the districts pay administrators exorbitant wages, and gobs of money gets thrown at better buildings.  Had enough? Is there a better way?

Kid's don't need better buildings.  They need better teachers, less bureaucracy and less centralized control. Flip the whole thing - attract the best and brightest to the teaching profession. Pay teachers what administrators currently make, give them a bigger budget for materials and curriculum, give them broad based guidelines for educational standards, destroy the unions, and fire (or at least repurpose) the administrators.  Let the teachers self-organize on each campus and pass the baton on administrative functions.

Next, empower students.  How about a student council that actually has real input into the administrative process of the school?  Imagine treating students like they are adults, giving them adult responsibilities and teaching them real world skills in real time.  Budget issues at the school? A great chance to learn economics as a student body. Social unrest? A perfect opportunity to learn conflict resolution and collaboration.  Make students the masters of their education.  Tell them it is partly their job to maximize the effectiveness of the educational experience.  Give them opportunities to speak into the process and recommend improvements.  Take them seriously. Create group goals and school wide goals and encourage students to self-organize for reaching those goals.  Teach them the importance of values and work with them in groups to craft values statements.  Show them how to use these values as guiding parameters for decision making and strategic planning. Teach the students to solve real world problems by giving them real world problems to deal with.  

In addition, educate parents that the buck stops with them for ensuring their child is educated. They should view the school and the teachers as resources to assist, not as a straight line hand over of their inherent responsibility to provide an education for their child. Discover ways to assist students who do not have adequate parental support structures.

Finally, spend just enough on facilities to ensure cleanliness, safety, and access to core educational materials.  Create collaborative workspace for students and encourage working in groups on problems to solve. Teach kids how to self-organize, self-regulate, and succeed together in groups.  Increase spending on things like music/band/sports/academic-decathalon/computers/etc. Reward teachers who teach kids how to learn instead of just what to think.  Put an end to standardized testing which results in "teaching to the test" and a bunch of rote classroom work full of perpetual ennui and mindless drivel.  Find out what works and then do more of that.  Find out what doesn't work and stop doing it.  Fail fast, pivot fast, learn fast, grow fast.

Just my $0.02 on the issue.  What are your thoughts?

Tags:

Aug 23 2010

Agile Everywhere

Category: Agile EverywhereJeff @ 18:43

I think Agile goes far beyond software development.  I'm thinking about ways to bring Agility to bear on all sorts of new and interesting places.  In that vein, I've added a new Agile Everywhere category to my blog.  This category provides a platform for the airing of my thoughts about ways to bring Agile to places it's never been before! Welcome along for the ride, I hope it's interesting and enlightening.

Tags:

Aug 6 2010

Lotpath is Hiring!

Want to work for an agile startup company in Fresno?  You're in luck because Lotpath is seeking to hire two C# .NET developers in the Fresno Area.  If you know of an interested individual, please direct them to the following website address:


The two PDF files on the page contain information regarding the positions and how to contact Lotpath to apply.  We look forward to finding a couple of quality developers to add to our growing team!

Tags: ,

Aug 3 2010

"Anonymous Types" in Ruby

Category: Software DevelopmentJeff @ 06:42

Readers of this blog know that I'm an avid C# .NET developer.  However, one can hardly survive long in this business without learning multiple approaches to programming.  In the C# world, we have functional programming (lambda expressions, action and func delegates, etc. ), declarative programming (config files, fluent interfaces, etc.), procedural programming (gasp!) and elements of object oriented programming (though C# isn't a "pure" object oriented language - it's actually "class oriented", but that's a discussion for another blog post).

In an effort to expand my horizons even further, I've started investigating the world of Ruby.  Ruby is a dynamically typed, interpreted language.  Many people have heard of Ruby in the context of Ruby on Rails (RoR) though the language can be used for general purpose programming as well.

As a first project, I wanted to see just how "dynamic" Ruby really is.  Well, it's not quite what I expected.  I had this idea that objects in Ruby would work something like an ExpandoObject in C# 4.0.  While Ruby objects don't work like this out of the box, it didn't take a lot of effort to accomplish this behavior in Ruby.

  1. class Anonymous
  2. def initialize(hash)
  3. hash.each do |key,value|
  4. self.class.class_eval do
  5. define_method("#{key}=") do |value|
  6. instance_variable_set("@#{key}", value)
  7. end
  8. define_method(key) do
  9. instance_variable_get("@#{key}")
  10. end
  11. end
  12. send("#{key}=", value)
  13. end
  14. end
  15. end
  16.  
  17. d = Anonymous.new :foo => 'bar'
  18. puts d.foo
  19. d.foo = 'baz'
  20. puts d.foo

Let's walk through what is going on here in an effort to better understand how Ruby works.  On line 1, I am declaring a class called "Anonymous" that I want to behave sort of like Anonymous types in .NET (but with both getter and setter behavior).  Line 2 declares a constructor for this class which receives one parameter called "hash".  Skip down to line 21 and you can see a few things going on.  First, a variable "d" is declared, and I am creating a new instance of the Anonymous type by calling Anonymous.new.  The really interesting code happens at the end of this line where I am defining a ruby hash.  Equivalent C# code would look something like this:

var d = new { foo = 'bar' };

However, in C# you run into a couple of issues.  First, you cannot change the value of "foo" anymore.  Second, you can't return this anonymous type from a method. Well, you could, but the caller would have no idea what the return type would be and couldn't work with your object without some nasty reflection.  Such concerns don't even in matter in Ruby, however, since it is a dynamic, interpreted language.

On line 22 I'm simply writing the value of "foo" out to the console (puts in Ruby is the .NET equivalent of System.Console.WriteLine()).  Notice that on line 23 I am able to change the value of "foo" from 'bar' to 'baz'.  The class Anonymous has been constructed to automatically create a getter and setter for "foo".  In declaring another Anonymous type, I can specify a different hash and attach a whole new set of properties to my object.  In just 19 lines of code, I was able to create a class with the behavior of an Anonymous .NET type, but including setter behavior.

In a future post, I'll dive deeper into the implementation details of the Anonymous class.  For now, I'll stop there and just ponder ways to use this functionality.  I'm impressed with Ruby's ability to allow the expression of complex behavior with minimal code.

(thanks to emilio for helping me get this Ruby stuff working!)

Tags: , , , ,