Home avatar

Thoughts and code

Simple MVVM Walkthrough – Refactored–Part 2

In the previous post I showed an attempt to get rid of the magical strings. It worked great for a string property, but failed for the integer one as JR has reported. I decided to look into that, but this time around through TDD and this is what I found (besides the fact that going TDD way would definitely catch it).

When a string property is passed in, returned object is expected therefore there’s nothing complicated, it works. Though, when an integer (or any other type that is not a string) is passed in, .NET implicitly applies Convert() method.

Simple MVVM Walkthrough – Refactored

JR has put together a good introduction post into MVVM pattern. I love kick start examples that serve the purpose well. And even more than that I love examples that also can pass the real world projects check. So I took the sample code and refactored it slightly for a few aspects that a lot of developers might raise a eyebrow.

Michael has mentioned model (entity) visibility from view. I agree on that. A few other items that don’t settle are using property names as string (magical strings) and Saver class internal casting of a parameter (custom code for each Saver command).

Goals for 2011

These are the goals I am setting to work on in 2011 and try to get them done.

  • Practice my agile skills with the new team, bringing it to the next level
  • Building a solid team
  • Learning and implementing CQRS based system
  • Participate and contribute for an OSS project
  • Learn MacOS and development in ObjectiveC / Cocoa
  • Use Mono
  • Learn ASP.NET MVC
  • Learn printing architecture on Windows and Linux
  • Learn embedded development (Java)
  • Finish basement – yes, a goal that is not computer related :)

This is going to be an exciting year!

VisualSVN Server - Enforce Comments

Pre-commit.hook
Pre-commit.hook

setlocal

set REPOS=%1
set TXN=%2
set SVNLOOK="%PROGRAMFILES(X86)%\VisualSVN Server\bin\svnlook.exe"

REM Make sure that the log message contains some text.
FOR /F “usebackq delims==” %%g IN (%SVNLOOK% log -t %TXN% %REPOS% FINDSTR /R /C:......) DO goto NORMAL_EXIT

:ERROR_TOO_SHORT
echo “Must provide comments” >&2
goto ERROR_EXIT

:ERROR_EXIT
exit /b 1

REM All checks passed, so allow the commit.
:NORMAL_EXIT
exit 0

2012-01-03: Post on StackOverflow on this: http://stackoverflow.com/questions/247888/how-to-require-commit-messages-in-visualsvn-server

Agile Sticky Board

I had a long plan to demonstrate in an animated way a software project progress without using any software or what is know in agile as Sticky Borad (stickies board). Wanted to capture the process of thought, the evolution and how things are dynamically progressing. The chance finally came to do so.

This is my 300th blog on weblogs.asp.net – circle being closed.

Enjoy:

Create your own video slideshow at animoto.com.

MbUnit–Hidden Gem

Row tests are fun. You can simulate various inputs with expected outputs and execute them all with a single observation (test). The problem for myself was always the fact that when this was done, the only way to accomplish it was to merge the logical because which operates on system under test behaviour and the observation itself (assertion). This leads to a slightly less readable code IMO.

Drive–Book

It started with Jonathan talking about the video he saw, [Drive: The surprising truth

image
image
about what motivates us](http://www.youtube.com/watch?v=u6XAPnuFjJc). I really liked it, and decided to proceed to the book. The book is outstanding, hits in the target. Among other things, I can definitely use it to explain a good portion of things that happened to me in the past. What is interesting, is what Daniel Pink describes as “Drive”, Mihaly Csikszentmihalyi describes as “Flow” (another book to read). I really liked the language and associations Pink has used in the book – software and computers. This makes analogies and examples extremely simple. Good read.

ReSharper Test Runner is SLOW

I love R#. It’s a great Add-on that makes Visual Studio .NET a usable tool. What I don’t like about R# is it’s test runner – so slow… I switched to use TestDriven.NET almost two years ago. In the last few weeks had to go back to R# test runner. What a difference. I tried to capture the difference on a video, so that you’d see the difference between R# test runner, TD.NET, and command line build script that does everything (compile and test). By the looks of it, R# takes about the same time as command line script. A tool that does literally miracles with VS.NET should be a bit snappier IMO.