Saturday, November 21, 2009

Vancouver Tech Fest GIT Presentation

I did a presentation on GIT for Agility at Vancouver Tech Fest today. Here are the slides for those who wanted them! Let me know if you want more info.

http://drop.io/vantechfest

Here are some links to good GIT sites:

Linus Torvalds on GIT: http://www.youtube.com/watch?v=4XpnKHJAok8
GIT magic book: http://www-cs-students.stanford.edu/~blynn/gitmagic/book.html
MSysGIT: http://code.google.com/p/msysgit/
GIT Extensions project for VS: http://code.google.com/p/gitextensions/

I'm glad people liked the presentation. The organizers will post the actual screen capture and audio later.

Monday, November 2, 2009

ALT.NET Vancouver is on!

We will have a FREE open spaces event held at the 500 Plaza Hotel (Cambie and 12th) starting at 5:30 pm Thursday, Nov. 5th! Participants will include:

Eric Evans
Michael Feathers
and possibly Martin Fowler and others!

This is your chance to participate in an interactive setting with a lot of the presenters from Agile Vancouver.

Please go and sign up at altnetvancouver.ning.com. Please message Stefan Moser or Scott Muc through that site regarding any details.

Books at Agile Vancouvre Conference

Since some people couldn't get the time off work or couldn't afford to attend the conference, they won't be able to get the great discount we have on some books that we have at 20% off the cover price. Please look them up online for the price and subtract 20%. We also include the tax in that price. Let me know through twitter:

Refactoring: Ruby Edition Jay Fields / Shane Harvie / Martin Fowler / Kent Beck
Fearless Change: Patterns for Introducing New Ideas Mary Lynn Manns Ph.D./Linda Rising Ph.D.
Working Effectively with Legacy Code Michael Feathers
UML Distilled: A Brief Guide to the Standard Object Modeling Language, 3E Martin Fowler
Domain-Driven Design: Tackling Complexity in the Heart of Software Eric Evans
Lean Software Development: An Agile Toolkit Mary Poppendieck / Tom Poppendieck
Patterns of Enterprise Application Architecture Martin Fowler
Planning Extreme Programming Kent Beck / Martin Fowler
Refactoring: Improving the Design of Existing Code Martin Fowler / Kent Beck / John Brant / William Opdyke / Don Roberts
Analysis Patterns: Reusable Object Models Martin Fowler
Leading Lean Software Development Mary Poppendieck / Tom Poppendieck

Tuesday, September 22, 2009

Much Ado About Agile 2009 Conference Registration is Open!

This is the line up:

Martin Fowler,
Eric Evans,
Michael Feathers,
Mary Poppendieck,
and others

The conference is going to sell out quickly as it is a small venue.

To register please visit www.agilevancouver.ca

Sunday, September 20, 2009

Event Sourcing and CQS part 1

Lets start by getting the transaction side of the application going. We're going to have a customer class that will have some simple properties at first.

Here is the project setup:


This is a pretty easy start. We have the test project that will exercise anything that we write. The messages project is where all our messages will reside. The Transaction Service will house our coordination of receiving commands to the Domain. We'll worry about the event publishing in a little bit. The Domain project will house our entities.

Time to get some sleep. More on this tomorrow.

Time Machine Example Implementation

A little while ago I wrote about a time machine for your application. This based on Greg Young's infamous Event Sourcing strategy. It's time to get a sample application going with this approach. I'll also take it one step further and apply the same strategy to the reporting side of the application. A lot of this hinges on the Open Closed Principle (OCP) so I'll try and enforce that through GIT hooks.

Here is a recap of the steps I'll be taking:

1. Event Sourcing and CQS to the extreme as prescribed by Greg.
2. Event Sourcing for reporting schema changes.
3. OCP application to the versioning of the dB instead of version scripts.
4. Enforcement of the OCP to the pub/sub of the reporting dB.
5. OCP application to the reporting services side through GIT hooks.

This will be hyperlinked as I complete the blog posts.

Friday, September 18, 2009

The Best Certification

The best "certification" is still community recognition by putting
yourself out there and learning/teaching publicly:

Blogging:

You put up your ideas in front of many eyes. Teach people. They will be better because of you. Learn from people. You will be better because of them.

Twittering:

An optimal conversation is hard to find within your geographical confines. Get the room full of conversations experience on the global scale. What you want to talk about right now is something that others out there want to talk about as well.

Participating in Forums:

To explain something in more than a 140 character-at-a-time conversation, you need a forum. People on forums are there to teach and learn. Participate!

Presenting at User Groups:

Sometimes you just need to talk to people in person and get your ideas out in that manner. Local user groups are great as the attendees are people that you can find common ground with, teach and learn from their critique of what you present.

Presenting at Conferences:

This is an extension of the user group but will connect with a larger group and geographical reach. It will help you develop as a presenter which will make you a better teacher and better learner. The evaluation forms will let you know where you can improve.

Reaching Out to Other User Groups:

Get involved in other user groups. Present there. See what the gap is between the groups. This new dialogue will be very important to learn why the groups exist and why the technologies/methodologies/etc behind each exists.

I resisted that for a long time and only recently bit the bullet to do all of the
above. Your "certification" is the recognition your peers give you.

People right out of school are having a hard time getting work. The
ones that are passionate are the ones that I see getting their career
going in the right direction. They are the ones that are still there
participating in the community. We started an Alt.Net Vancouver group
which is tiny compared to most user groups. But I have a hard time
finding more dedicated people. The inexperienced people are getting
their best "certification".

Hope this will save some people from memorizing index cards and put their time to good use instead!

Thursday, September 17, 2009

Layers Talk

I put together a talk on layers for TechDays. This is part of a new track that Microsoft is piloting in Vancouver and Toronto. Due to the constraints of time, I had to eliminate some of the subjects that I was originally going to cover. One of them was scalability. I've included the original layout at the end here and hopefully I will be going back to this post and adding some links to subsequent posts. Design by Contract was added as the replacement subject.

Thursday, September 10, 2009

Cake Please


I spent the last week and then some preparing a "Layers" presentation. The focus was to try and get away from what's been taught 20 years ago and the 3-tier UI-BL-DL structure.

My first attempt was to concentrate on why software was organized at all. It's to manage growth. You don't need any structure if you have a very simple system. With growth comes a demand that goes beyond the organization of the logic. Most modern architecture topics deal with the growth of data that companies need to manage. On top of that is the other -ilities.

So, scalability and the layers was going to be it. I guess it fell too much on the database at first. The other layers got the raw end of the deal. But wait. That would have been irresponsible.

The truth is that the structure of such companies is really now a system of systems. Each system may be a cake or a few. The trick is now looking at what sits on top of the shards, document dbs, object dbs, etc.

So the presentation really turned into an SOA talk with some Domain Driven Design. By diving deeper, the Domain Driven Design turned out to be a vortex with one idea relying on the other - not unlike mathematics: If you want to learn calculus, you better know basic algebra.

So back to the basics it was: MVP, MVC, MVVM, Transaction Script, Active Record, Domain Model, Data Access and ORM - touching on DbC, DDD and SOA for the second half. I'm happy that I got to use napkin doodles for my diagrams - UML belongs on those things. An MVP diagram looks better next to a coffee cup stain anyway. MS will probably clean all this up :-/

I don't know. Maybe I'm too tired at this point in the night. I didn't manage to work GIT in to the presentation. Next time.

Monday, September 7, 2009

A Rewind Button For Your Application Without the Temporal Object Pattern

In Ayende's style, I will blog as soon as a thought comes to me.

In the last year or so, I have been working on applying the Event Sourcing pattern. This led to some interesting thoughts. With the fact that the state of any object will be "rewindable", you can do a true audit. Audit logs don't cut it as Greg Young has put forth in his presentations.

That's great for the state of each of the objects. With a bit of work, you can work out anything that might have happened on any reporting that you may need or needed. This may be quite a task to merge your structure and lookup data changes in the reporting db and the actual events that update that data.

To add, the more difficult task is to have the reporting service changes merged as well. This would not be so bad if the Open Closed Principle (OCP) was adhered to - but only for when new events were added. If the reporting service started to act differently as of some arbitrary version, a careful replay of the system through time would be needed with binaries ready for each timespan that they were around for to receive those events.

There is the very explicit Temporal Object Pattern that seems tempting to use. However unless the domain is clearly responsible for knowing it's own contracts, this looks like a very complex solution to put forth as we will want all our objects to be temporal - and our reporting data as well. This is just a wish to have a rewind button on my app to have a truly representative audit.

So now that we've described the problem, let's take a look at a possible solution: Event Sourcing. As stated earlier, this allows us to capture events that the domain publishes and add the ability to reconstruct an objects state using just what has been published in the past. A very good implementation of this pattern was thought up by Greg Young. Martin Fowler writes about it here.

That solves the problem of the rewind button working on the objects themselves. How can we do the same for the rest: reporting services and the reporting schema? The trick is that the state of the objects is write-only via the events they have published so far. To have the same effect for the Reporting Service, we need to adhere to the OCP and publish an event called "CustomerReportService2 will now listen to all CustomerEvents from now on". We keep both versions of the service alive. We can also say that another message is now going to be consumed by the second version from now on at a later point in time.

This simple fact that we are closing the old service functionality from that point on in the event stream is key. It also gives us the same thing for the dB schema. When we add a table or column or lookup item, etc., we publish the schema change as an event. When rewinding the clock, we drop all the tables from the dB and simply replay all events from the beginning of time through the latest binaries. This may take some time, so some snap shot concept can be introduced as is with Greg's Aggregate Root object snapshot idea.

If we adhered to the OCP, the reporting service and schema will have been used as it has before. The slight overhead is the management of which version of the reporting logic is used when. It listens for when to switch directing of the messages to a particular version of the service. Sounds like a job for an Inversion of Control (IoC) Contianer?!

So.. It always comes back to this: GIT hooks that prevent you from changing certain files in certain ways! The db script can only be added to! The reporting service cannot be changed - just ammended! OCP insurance from your source code management is a cool concept.

That's the best accounting system for software I can think of.

Looking forward to critiques of this and questions for clarification since I offered no diagrams. I probably will update this with that info later.

Wednesday, September 2, 2009

GIT for fun and profit presentation application

Tired of unreliable source code management? Do you save your source code in 6 different places and put a hard copy of the work you did today under your mattress when you get home? ... then you need to see how GIT's design will allow you to throw off those shackles and become a free person again!

... but wait..

Are you scared of switching to a different source code management tool because the last time it took 3 developers, 2 project managers and all of Accenture's employees in western Canada to deploy your barely functional current one? Well not this time! If you are better at copying a file than your technically challenged mother, you can deploy a git repository! You will be shown how.

and then...

Did you avoid work today because you feared missing your lunch hour break? Because getting the latest version of your solution would take so much time over your 14.4 kB modem? Thinking of switching to AOL? GIT will compress and send only the changes that you need. Take a look at why even on your beautiful dial-up connection, GIT will enable you to contribute to that open source z-modem implementation you're working on.

.. but what about this:

Constantly forgetting to check things in because you're preoccupied by those Britney Spears albums in your iPod? Did your last checkin encapsulate the project from beginning to end? Well wait! With GIT it's not too late to save yourself the horrible embarrassment of this gigantic checkin! Come discover how!

... if you're not convinced yet:

But my mom keeps tripping on and unplugging the interweb cord out of the wall when I'm working on my Dungeons and Dragons program - so I can't checkin my changes! ... And I need the new elf package to be implemented before my D&D Saturday night party! Well, don't fret my nerdy friend. GIT works without a connection too! Find out what else is possible!

.. I'll try to convince you with just one more..

The evil developer from across the office is committing changes to the files I'm working on! He types way faster than me because he uses a Dvorak keyboard and beats me in the check-in race! He gets work done and I spend my day resolving conflicts. GIT, can you help me here as well? Of course GIT can. With 9 different merging strategies to help you, your evil foe will quickly fall to the wayside and you can laugh at him when he's layed off.

Thursday, August 27, 2009

Some Reasons I Love GIT

It's no secret by now that I'm at a "won't turn back" point in terms of SCM. The fundamental ideas that GIT is based on come through in the use of the system:

1. Reliability: Every change is keyed on a SHA of it's contents. You quickly know if there are any integrity issues.
2. Simplicity: It's just a bunch of files organized by a directories comprised of the first 2 characters of the SHA. In those directories exist the serialized blobs of deltas and other items (trees, commits, tags and branches). The files are named by the remainder of the SHA. It's also snapshot-based as opposed to file-based. Moving a method tracks that as exactly that - not 2 separate changes in 2 different files. It's easy to fix a repository if there was some hard disk corruption.
3. Speed: Everything is compressed so the repositories are 1/10th the size of an SVN repository and hence faster. You have a local copy so looking at the log or doing diffs is almost instantaneous.
4. Power: Forgot to add that other little change in your last commit? No problem just amend. Committed 2 changes at once? No problem, tease apart that last commit into 2+ separate ones.
5. Off-line: never need a server. Even at the current gig, no server software installed anywhere for the centralized repositories. It's just some folders on a mapped drive.
6. Merging: It's built for it. SVN's merge tracking is put in as an afterthought. GIT was designed for it.

There's more and more detail, but I needed to answer the question for Steve Bohlen.

Tuesday, August 18, 2009

GIT shortcuts

Time to revise the GIT short cuts. I've added these in ~/.bashrc:

alias ls='ls -lAXh --color'
alias gup='git push'
alias gdl='git pull'
alias gc='git commit'
alias gl='git log'
alias gd='git diff'
alias gdc='git diff --cached'
alias gdh='git diff HEAD'
alias gb='git branch'
alias gt='git tag'
alias gm='git merge'
alias gs='git status'
alias gco='git checkout'
alias gcl='git clean'
alias grs='git reset'
alias grb='git rebase'

Monday, July 6, 2009

Get Windows Live Messenger 9.0 Working on 64bit XP and Server 2003

Microsoft says that these are not supported. But they actually are.

You need to download the MSI version of the installer. It's available here:

http://www.softpedia.com/progDownload/Windows-Live-Messenger-9-Download-89148.html

You may then get the "cannot connect to server" message. In that case, upgrade the communication plumbing by installing this:

http://download.microsoft.com/download/0/F/4/0F4D43A7-8D47-4312-BC35-EC1F888AC156/en/Contacts-ship-neutral.cab

You should be able to connect at that point.

Thursday, April 23, 2009

An Interesting Discussion with Robert

I seem to always get into good conversations with Robert. We thought we should share it and perhaps it will start some more meaningful discussions.

Adam said:
BTW, thanks again for the invite yesterday. Good presentation. I liked the mind map way of displaying the ideas

Robert says:
Thanks Adam. And thanks for the input and clarifications; It was very interesting to see people's reactions to the ideas. Good discussions.
Robert says:
It seems that there is a considerable level of comfort with the idea that the status quo is broken.
Adam says:
yes.. please pass along my contact info to them.. they sound like a bunch of smart guys
Robert says:
I will.
Adam says:
sometime next month we'll have a geek beers again.. I like the presentation idea
Adam says:
I'll try and think of something like that for the next one
Robert says:
Nothing too excessive, I hope . Excessive presentation, I mean - shouldn't distract from the beer too much ...?
Robert says:
Just kidding - good idea.
Adam says:
no.. for sure.. but it's good to give some food for thought to the people
Robert says:
Indeed. If for no other reason than getting a better feel for how jaded, exactly, everybody is. That notion that building apps is broken, but that's just the way it is / will be / makes money.... Eerie.
Adam says:
ya
Robert says:
Not that I'm advocating revolution or anything, but I wonder to what extent that's a self-fulfilling promise and to what extent we actually have the answers and are just not implementing them .....
Robert says:
.... because of resignation - "it'll never work in any other way."?
Adam says:
there are multiple answers
Adam says:
it takes time to implement them all
Adam says:
what's needed is better tools
Adam says:
or larger adoption of good tools
Adam says:
there a few combinations of answers that don't work together
Adam says:
but the people that know the answers, know that anyway
Robert says:
Not sure about that. There seem to be more better tools about than you can shake a stick at. Adoption seems to be key, and it's linked to culture and language, just as was alluded to yesterday.
Adam says:
how many developers do you know practice DRY by using the built in templates in Resharper, for example
Adam says:
or better yet
Adam says:
how many develop their own templates
Adam says:
or macros in VS?
Robert says:
Very few. The interesting question is why that is so.
Adam says:
There is no reason, for example, that developing an ORM w/ MVC app in .NET should be as be as fast as developing in Ruby on Rails
Robert says:
"Insufficiently experienced" is the pat answer, but that doesn't capture it.
Robert says:
I think it has nothing whatsoever to do with tools, frankly.
Adam says:
I think softwareshops are too shortsighted that devoting just 1/2 an hour a day to sharpening the saw would make the difference
Robert says:
Yes, undoubtedly, but why?
Adam says:
Fire those who refuse to learn
Adam says:
Fire those who don't learn for whatever reaso
Adam says:
n
Robert says:
Learn what? Fired by whom? (as in, who makes the decision that they aren't learning) Replace them by whom?
Adam says:
it has to come from the top
Robert says:
The factors which cause the entropy are deep - human nature, culture, etc.
Adam says:
yes
Robert says:
Jawohl mein Fuhrer. Not to be facetious, but if it could be imposed just like this, we'd be as good at it as we are at digging ditches in no time.
Adam says:
but if actively the organization fights entropy, you have a better than the rest scenario. At this point it's worth fighting for
Robert says:
All organizations are actively fighting entropy. That's what an organization IS - a means of shaping reality and staving off entropy.
Adam says:
There was a good saying. "Look at that tractor there. If we got rid of it we could have 50 people shoveling the dirt."
Robert says:
It seems that the problem is agreement on exactly what constitutes order and chaos, and to what end.
Adam says:
The other guy says: "Why not use spoons, you could employ 500 people"
Robert says:
And why not, if the 500 would otherwise turn into antisocial drunks without purpose and happyness in life. Perspective has a lot to do with it.
Robert says:
.. happiness, of course....
Adam says:
yes.. I feel a rush of communism coming over me
Robert says:
How come it's about ideological correctness in software development and not in electrical engineering? What is the difference? That's what I don't understand.
Robert says:
Everybody seems to know what needs to be done whilst at the same time conceeding that it'll never work.
Adam says:
I'll tell you the difference between software and any other engineering
Robert says:
The "fire everybody who won't learn" / "don't work with anyone who isn't competent" theme was fervently supported by one of the guys last night, you, Greg Y, myself in darker moments.
Robert says:
All that knowing full well that that can't be done either.
Adam says:
yup.. so the current concensus now is architectural segregation via SOA done properly, ie, under the guidence of DDD
Robert says:
That's like the current political consensus that it's better to be free than slaves.
Adam says:
it's too easy to build software
Adam says:
mistakes have no harsh consequences
Robert says:
... what does "free" mean, whose "slave", etc.
Robert says:
"mistakes have no harsh" (especially near-term) consequences - that may be closer to the mark ....
Adam says:
if you burnt the wrong circuit on the board, it's toast
Robert says:
Curious that everybody either goes commie (extreme programming, etc.) or totalitarian when looking at the problems....
Adam says:
if you made a syntax error, you type something and recompile
Adam says:
lol
Adam says:
I love that comment
Robert says:
Yes, but that's not the true picture. You just recompile, but .....
Robert says:
.... as we both know the true consequences of a series of suboptimal decisions when building software can ruin companies.
Robert says:
That's why patterns and antipatterns seem like such a good idea. They make consequences more obvious and help to prevent bad choices.
Robert says:
The problem is that that's fairly well understood by now by technicians, but I know of a good number of entrepreneur and PM types who are blissfully unaware of the chain of events which made their stuff unmaintainable/useless/very costly even after everything folded.
Robert says:
It's as if our nice little patterns should each have case studies attached to them which attempt to quantify the effect of the pattern / antipattern in financial terms, for better or worse.
Robert says:
I wonder if that's possible.
Adam says:
too many variables
Robert says:
Not if one could classify the organisations and "cultures" which attempt to apply the pattern/antipattern in some way.
Robert says:
For example, patterns would have a different effect when used in an open source project, a dotcom style entrepreneur shop and Telus.
Adam says:
still lots of variables.. but you're getting closer
Robert says:
We should toss this thread into a blog post.
Adam says:
perhaps it's the quantification of the things we have not been quantifying that's the problem here
Robert says:
Yes. That sounds likely.
Adam says:
So we can explore that..
Adam says:
I'll post this on my blog when we're done
Robert says:
OK.
Adam says:
so, let's have "transiency" as a variable worth measuring
Adam says:
what is the percentage of consultants here
Robert says:
..... "transiency" .... ?
Adam says:
how many do short stints?
Adam says:
how likely is it for a person to leave if they don't like it
Robert says:
No idea, or even particular opinion on what metrics may make sense. I feel that it would need a lot more discussion before touching that one.
Adam says:
"relative compensation" - do the people get paid the average that is out there in town, more, less, by how much?
Adam says:
related to the previous, but imortant
Adam says:
.. to be looked at separately
Adam says:
"implied incentive" - is this a 9-5er or someone that fell in love with the art?
Adam says:
"personality type"
Adam says:
- do we have a bunch of type A personalities comprising the team
Robert says:
It sounds to me as if that's too focussed on the techies who do the coding and not enough on the "culture" of the organization in question.
Adam says:
ok.. you name a few
Adam says:
we'll need combinations of these matrix to throw methodologies and patterns at to see what happens
Robert says:
As I said, I'd have to think about that and would like to hear more opinions. For example: .....
Robert says:
Staff turnover probably plays a role, but do we need to look at it or those factors of which it is a symptom?
Adam says:
yes
Robert says:
I really don't have an opinion about that yet.
Adam says:
I think propensity to leave tied to that rate itself
Adam says:
it's not an easy equasion
Robert says:
Absolutely.
Adam says:
looks more like a y=y`` + y` differencial equation thing
Robert says:
Dave made an interesting observation yesterday, to the effect that the "shared language" would require a culture built in a stable organization with long-term folks who know the shop and each other for years, etc. as a prerequisite and that the perspective of "hired gun" outside consultant architects (or folks with that kind of mindset - admit it - he was describing us.....?) would be entirely...
Robert says:
different from these folks.
Robert says:
That one also had the ring of truth, somewhere.
Adam says:
I don't buy it
Robert says:
There's a lot of stuff here which smells of needing more input from people. It seems too early to narrow down the questions to ask.
Robert says:
The notion that an ubiquitous language has to be embedded into a culture in order to work has a very strong possibility of being true.
Robert says:
Look at languages: They cannot survive without a living culture around it.
Adam says:
yes
Robert says:
In short, a culture must be there which buys into the need to speak the language....
Adam says:
but all you need is a domain expert role and you're good
Adam says:
perhaps one for each context if you're going down the DDD path
Robert says:
... which brings us right back to the crux of the matter: Selling the notion that all this stuff about developers and domain experts need to work together on the ubiquitous language thing and therefore need time, no waterfalls, etc.
Robert says:
It seems to be about acceptance in the "culture" of the company. Otherwise, no management support, etc.
Robert says:
If it weren't so, agile would rule the world.
Adam says:
not sure about that.. agile can't rule the world because of the personality types out ther
Adam says:
there are planners that will, by nature, go against agile
Adam says:
not even intentionally
Adam says:
it's not about "getting it"
Robert says:
No. It' can't rule the world because the principles which make it successful can only be applied by a small percentage of the best and brightest.
Adam says:
it's simply human nature
Adam says:
not even best or brightest
Robert says:
.... whereas a culture needs to include all participants in order to flourish.
Adam says:
yes
Adam says:
so agile is dead in the water
Robert says:
Heck, the stuff is too complicated.
Robert says:
No, not really. Whatever comes will have a lot to do with it.
Adam says:
it's achilie's heel is the way that it forces companies to work
Adam says:
hence lean is a more palatable way of working
Robert says:
Maybe. It's as if we are missing a way of doing things which follows the "natural contours" of how people and companies actually operate.

Monday, February 9, 2009

New Developers Are Just Over-Confident Children

Having a little one to look after has shed some light into how we get the software in most shops today. This quote is quite good in how it relates to our educational systems:

"For the true significance of Disneyland is that it reflects our notions of children - what they are, what is good for them, and what will please them. Children are a special class of human beings which came into existence with the industrial revolution, at which time we began to invent a closed world for them, a nursery society, wherein their participation in adult life could be delayed increasingly - to keep them off the labor market. Children are, in fact, small adults who want to take part in the adult world as quickly as possible, and to learn by doing. But in the closed nursery society they are supposed to learn by pretending, for which insult to their feelings and intelligence they are propitiated with toys and hypnotized with baby talk. They are thus beguiled into the fantasy of that happy, carefree childhood with its long sunny days through which one may go on “playing” - in the peculiar sense of not working - for always and always." - Alan Watts