Category Archives: Castle

See http://www.castleproject.org

DevTeach : The .NET place to be

Just came back from DevTeach day 2. Wow! So much great speakers. A year ago, I would never had tough that Montreal was a place for such a great event. I’m pretty proud to’ve been a part of it.

Now! Enough for the flattering.

First I attended Claudio Lassada’s Tips & Tricks to boost up productivity session. He presented a couple of tools to speed up things (slickrun, jot, sysinternals). But I still think the key is only to go mousless, everything else will follow (And I think launchy is a lot better then slickrun). Among other things he promoted dual screens, weekly brown bag meeting, in which you share tricks you’ve learned, and CodeRush (I prefer ReSharper). Still it was really entertaining and a great start for the day.

Then I jumped to the Agile room where I stayed all day. Scott Bellware kicked it off with a talk on Behaviour-Driven-Design. The whole session was about refactoring a real world example using a TDD approach. He then presented BDD as a way to make test code more english-like and self documenting. It was a great presentation and a real convincing one. He talked about RSpec and NUnit.Spec but not as much as I would have expected. He sure looks like a bright guy (read: he’s bald). During that same presentation Jeremy Miller had some noticeable comments:

If its hard to test change it!

Yeah testability is one important thing when you don’t have the flexibility of a dynamic language.

After that was Oren Eini on Rhino Mocks. Even tough it was hard to understand what he was saying at first (strong Israel accent I guess) it was worth the effort. He made pretty obvious all the powers of Rhino Mocks. One other amazing things was how fast he was coding. I first tough it was a recorded video played with boosted speed. Not! He’s a true ReSharper jedi! He ended on a thoughtful note:

watch out for test paralysis

In other words: keep your tests flexible so they don’t break all the time.

Lunch was filet de porc in some brown sauce. Vegetables? Yes! Great I was hungry! Dessert was strange tough: looked like ice cream but was really a cake with strawberry toping inside. Still it was okay plus I had some great talks. Finished my coffee and I was up and running.

During lunch, in another room (yeah, really while lunch was served!!!) there was a talk about pair programming by two girls from Oxygen Media. Great talk, too bad I came too late (I was hungry!) I missed the rabbit story, what was that about ?

Then was Udi Dahan on What to Test and When. Udi is such a great speaker, so much energy when he talks, he sounded like Anthony Robbins on software testing. He focused on the importance of testing every aspect of the software on each iteration, specially the risky parts: performance, security, complex business logic and external interfaces.

Finally, Oren Eini finished it up with a MonoRail tribute. I don’t know if the crowd cough the brilliance of MonoRail, only 2 people, including I, had used Ruby on Rails! I tough Oren approach for a first dive into MonoRail was brilliant. He started with a browser and pointed to http://localhost/home/index.devteach then followed the exception messages for adding a controller, an action and a template. Talk about descriptive error messages!
The funniest quote of the day is definitely when he pointed out some recent comment on brail’s template, made by developers on an earlier talk:

This is Perl, I’m not doing Perl!

funny!

1 Comment

Filed under C#, Castle, conference, montreal

Great Castle Windsor articles

Alex of Bitter Coder got some great articles about Castle Windsor container project.

Here’s the last one about Startable Facility or if you’re new to this great tool start with Part I – Simple configuration.

Nice work Alex, thanks for sharing your knowledge.

1 Comment

Filed under C#, Castle

svn co castle; svn ci

Hurray! I’m now a Castle Committer! I’m committed to commit as a committer to castle’s committers community’s committee.

Thanks to hammett and the whole Castle’s crew!

Leave a comment

Filed under Castle

Castle Generator now on Castle trunk

A couple of weeks ago the Generator project was voted to be moved from the contrib repo to Castle main trunk. I’m ambivalent about this. Initialy I was happy to find lots of great people finding it usefull. Then, when I realised that I had lost control of the projet, I was frustrated. I know this was part of the contract. But it’s hard to just… let go.

7 Comments

Filed under Castle, Generator

Ajax Scaffolding with Castle Generator

Dan Bunea created an generator for Ajax Scaffolding, check out the step by step instructions on his excellent blog, Becoming Agile.

Wow!

3 Comments

Filed under C#, Castle, Generator

NProject up

Thanks to hammett, NProject is now up and running on castleproject.org server at nproject.castleproject.org.

Thanks hammett!

3 Comments

Filed under NProject

NProject site down

Has some of you might have noticed, the NProject web site is down. freewebdot.com was hosting it for free, but due to some abuse, they revoked all the free accounts… If someone knows about a free .NET web host, drop a line!

3 Comments

Filed under NProject

Live coding revisited

I previously bloged about a script that enabled automatic rebuild and restart of the web server on change of the source files. The script was working great, but sometimes some strange errors start poping out.

Thanks to Nick Hemsley who submited a patch that uses FileSystemWatcher, we now get much better results!

I refactored the script a bit and here’s the result:

import System
import System.IO
import System.Threading
import System.Diagnostics

# The command to launch the web server
SERVER_CMD = argv[0]
# Determine if the web server has to be restarted
# afther a built
SERVER_RESTART = argv[1] == 'restart'
# Arguments to send to with the server command
SERVER_ARGUMENTS = join(argv[2:], ' ')

# Arguments to send to nant when building
# Typically the target that builds and some arguments
NANT_ARGUMENTS = 'build -nologo -q'

# Time to wait before watching for changes again
REBUILD_DELAY = 1000 #ms


######## Stop editing here unless you're a damn cool Boo hacker ########
watcher = FileSystemWatcher(Directory.GetCurrentDirectory(), "*.cs")
watcher.IncludeSubdirectories = true
print "Starting live server process, hit CTRL+C to stop"

serverProcess as Process
rebuild = true

while (true):
  print "nant ${NANT_ARGUMENTS}"
  buildProcess = shellp('nant', NANT_ARGUMENTS)
  buildProcess.WaitForExit()
  rebuild = false

  if (buildProcess.ExitCode == 0):
    if SERVER_RESTART or serverProcess == null:
      # Try to stop the server
      if (serverProcess != null):
        try:
          serverProcess.Kill()
        except e:
          pass
        serverProcess.WaitForExit()
      # Starts the server
      print "${SERVER_CMD} ${SERVER_ARGUMENTS}"
      serverProcess = shellp(SERVER_CMD, SERVER_ARGUMENTS)
  else:
    print "Build failed! Errors:"
    print '=' * 80
    print buildProcess.StandardOutput.ReadToEnd()
    print '=' * 80
  
  Thread.CurrentThread.Sleep(REBUILD_DELAY)
  change = watcher.WaitForChanged(WatcherChangeTypes.All)
  print "File change detected (${change.Name})"

Whenever a .cs file is modified, nant is called to recompile the app and the web server is restarted.

Usage: booi script/server.boo YourWebServer.exe restart|norestart Argument For Your Web Server

On with Mono, you got to enable MONO_MANAGED_WATCHER, or else sub directories wont trigger a rebuild.

export MONO_MANAGED_WATCHER=1
booi script/server.boo xsp2 restart --root public $*

If the restart parameter is used, the web server will be restarted on each file change.

This script is now part of Castle Generator. To be as cool as I am, get into live coding:

svn co http://svn.castleproject.org:8080/svn/castlecontrib/generator/trunk generator
cd generator
nant install
cd ..
monorail MyBlog
cd MyBlog
nant setup
script/server


and start coding!

Leave a comment

Filed under Generator, Monorail

Database migration for .NET

Migration for .NET first official release is out and supporting MS SQL Server 2000, MySql 4 and Postgre 8 and fully integrated with Castle Generator.

Continue reading

25 Comments

Filed under Castle, Generator, Monorail

Generator vs burritos

If you want to join the fun, be sure to check my other post, on how to install this great piece of technology.

page_1.png

All images taken from Google with some random keyword search

1 Comment

Filed under Generator