Apr 22 2008

NServiceBus Tutorial

Tag: Open Source,SOASymon Rottem @ 10:28 pm

Staying on the SOA theme, there was a post today on the NServiceBus mailing list from Mohamed Ahmed Meligy about the NServiceBus Tutorial he’s put together.

Mohammed is working for a company that’s been evaluating NServiceBus for an internal project and they’ve been kind enough to share the document with the rest of the community using a Creative Commons license.

The document will probably be evolving rapidly, but right now it’s an excellent starting point for anyone who’s trying to get their head around using NServiceBus as their messaging middleware, so go and take a look to get you off and running.


Apr 16 2008

The SOA Question

Tag: SOASymon Rottem @ 8:37 pm

For quite some time now I’ve been dabbling away at the edges of SOA trying to properly wrap my head around it so I can become a comfortable practitioner, but there’s a lot of guff out there from vendors which has been distracting.

I’ve been keeping up with Udi’s blog for a while now, where he often has good information about the SOA world which in turn led me to tinkering with NServiceBus.

More recently, however, I started reading Bill Pool’s Creative Abrasion blog.  He’s been talking about what SOA is, and what it isn’t and how to spot the difference, to cite a few recent examples.  These have proven an interesting read and I recommend Bill’s blog if you want to get your head around the concepts of SOA and how they work in your world.


Apr 08 2008

MonoRail ‘Getting Started’ Docs Refactored

Tag: CastleSymon Rottem @ 10:22 pm

Well, that’s that done for now. *dusting hands*

I’ve been working my way through the Getting started chapter of the MonoRail documentation and have refactored a lot of the content, fixed the links so they land where they’re supposed to and added a few extra explanations. The current version can be viewed online here:

http://www.symbiotic-development.com/monorail/html

Thanks to a patch from Louis DeJardin (who provided the Windows Workflow Foundation facility in Castle) there are now navigation links at the top of the page to allow you to choose chunked, single or CHM versions of the content.

There appear to be a lot of problems with the DocBook syntax highlighter – it’s very fragile and not nearly as flexible as I’d like. I think I’m going to have to take a hack at the xslthl package and see if I can figure it out. Or if anyone else out there feels like it… :)

I’d love comments, suggestions or patches for anything that’s not clear or incorrect so feel free to dive on in.


Apr 07 2008

More Distributed Revision Control

Tag: UncategorizedSymon Rottem @ 9:40 pm

Following up on my last post about distributed revision control systems it seems that the buzz is all around town now…am I just late to the party?  I just saw the Ken Egozi has started trying to get off the ground with Git.

I’ve been doing a bit more research to understand what the phenomenon is all about and I think this comment (which I’ve trimmed slightly for brevity) left on Coding Horror by Vincent at Genezys (blog in French) explains some of the reasoning nicely:

…I agree with you about distributed source control that it is not easy to see the difference with centralized source control…this if often a misunderstanding of what a source control system is. I think all programmers will agree with me that source control system allows:

– to work on a common source code ;
– to keep an history of the changes ;
– to back up your work.

The order I choose is intentionnal, this is the way people understand source control. First I can share with others, then I save history, and then I feel safe because my code base lives in a secured server.

With distributed source control, the goal is primarily to keep an history of the changes. Sharing the code is secondary. Backing it up is not even a feature.

That is why it is so confusing to switch to distributed source control. With distributed source control, history is the main thing. They considered this feature so important that they allow you to browse your history while being offline. You can share with others later.

There is some advantage to that. First, this is much harder to break the build. You don’t have to push untested code or quick and dirty fix “just to save them” because you can save the history locally, do all the testing another day, and finally merge the whole history back with others.

Merge are easier too. With SubVersion, when a conflict occurs, you MUST resolve it before commiting your changes. But you may not understand the conflict and you really really don’t have time to fix that right now. Because distributed source control keeps a whole repository locally, merging is not mandatory when a conflict occurs. You can keep the two versions and choose to resolve the conflict later. Or even ask the programmer that introduced the conflict to fix it.

Personally I’m still a little hesitant to migrate anything I’m working on to a new revision control system at this stage; Subversion is working very nicely for me at the moment, and I’m not sure how mature the GUI tools are for working with these systems…and I do love my full coverage GUI tools. Excuse me while I go and make an offering to the Tortoise gods…

Regardless of my reservations on my own projects, I can certainly see the value for a larger, more distributed projects such as the Castle stack, NHibernate (which are not using DRCS at moment) or Ubuntu (which is) where the development team is distributed and the code base takes some real work to grok. It would be really nice to be able to work on the code for something complex and be able to check in while experimenting so a roll back would be possible if the wrong path was followed – and this is not easy with Subversion if the repository is remote and even more so if you don’t have write access.

If anyone has any broad coverage GUI tools to recommend for use with the current crop of DRCS-es I’d love to hear about them.

On a side note, I did stumble across a project that uses Subversion into a DRCS called SVK which was interesting. I don’t know how it stacks up against the others, but interesting nonetheless.


Apr 06 2008

Distributed Revision Control

Tag: UncategorizedSymon Rottem @ 4:23 pm

In general, there appears to be a lot of noise about source control on the web at the moment; Ayende has been writing about the SvnBridge for TFS he’s been working and Jeff Atwood from Coding Horror posted today about setting up a Subversion server under Windows. Within hours Scott Cowan (who I had the pleasure of meeting at the London ALT.NET conference) explains on his blog how easy it is to set up a local SVN installation on your own machine. Source control is the flavor of the week.

It’s funny how some ideas seem to gain traction and then hit a tipping point so that suddenly, something you’ve never heard about before comes at you from several disparate sources in a short space of time.

Until Friday I’d never even heard of distributed revision control.

Initially one of my colleagues mentioned it and since then I’ve seen a reference to Bazaar in the Ubuntu developer documentation (which is the revision control system they use) and Jeff’s post also referred to distributed revision control.

All of this prompted me to start doing some research – I’m just starting to dig in, but there appear to be several implementations out there at the moment that support distributed revision control such as:

There’s even a write up comparing some of these systems by demod on his blog.

I’m not entirely sure where I stand on DRCS at this stage as I haven’t yet had a chance to play with one. I’d be interested to hear about people’s experience with different systems.


Mar 31 2008

NHibernate 2.0 Alpha

Tag: NHibernateSymon Rottem @ 10:41 pm

For those of you who aren’t already in the know, the new version of NHibernate has entered it’s alpha release stage. This brings the codebase almost into line with the current Java Hibernate release (3.2) with a couple of exceptions so this is definitely something to write home about.

A few of the key things that I’ve been waiting for in this release are:

  • Inspection/traversal, modification and cloning of ICriteria
  • Table per subclass mapping with a discriminator
  • MultiCriteria
  • Mapping of one class to several tables using the <join> mapping.
  • Events and listeners

The changelog goes some of the way to explain the new changes in more detail than I have, but there’s a more comprehensive rundown on Ayende’s blog if you want a little more meat to chew on. In addition, Fabio Maulo (one of the NHibernate developers) noted that there are a couple of additional features that are notably missing from the changelog; namely the Merge and Persist methods on ISession and extended cascade mappings, unionsubclass and on-delete on the mapping side.

In reality you do need to take some care before upgrading since this is an alpha, but you can rest assured that the code is not brand spanking new, untested and unused. As Ayende mentions in his blog post…

We call this alpha, but many of us are using this in production, so we are really certain in its stability.

Anway, the call is out to start playing with the new version so the developers can get some real-world feedback on how it’s working in your environment and a chance to fix any issues before they give it their blessing for use in more critical and widespread environments. The Castle trunk has been updated to use this new release, so it can’t be too bad now, can it?

If you do decide to upgrade there are some breaking changes to be aware of, but most of them shouldn’t cause you major problems unless you’ve decided to bend and twist NHibernate more that the average user.

Also worthy of note is that there don’t appear to be updated docs available yet, but since most of the features of the new version match those of the production Java version their docs should help you get a good idea of where you are going.

You can keep up with what’s going on with others who are using the new version, get help and can provide feedback on the new NHibernate mailing list as well as the forums. At the moment the mailing list is very active so it’s a great alternative to the forums if you don’t get any response there.

I’ll be taking the new NHibernate for a whirl myself very shortly and will post on my experiences as they happen.


Mar 26 2008

Where does all the time go?

Tag: UncategorizedSymon Rottem @ 11:44 pm

Wow.  Time passes – fast.

I’ve been working hard on taming the docs for Castle as many of you already know and although I’m making progress it sometimes feels very slow.  This is especially true when I find myself with too many other things on my hands – business travel to Italy, refactoring code,  mentoring colleagues and trying to grok legacy software from the bowels of a system at work to name but a few.  The last is especially fun when the developers who wrote the code have not been with the company for years now…

So, the reward for all this hard work?  More hard work?  No – sod it – I’m taking few days off to drive around the south of France.

Regardless, in an effort to maintain forward motion on the MonoRail docs, for those of you who’ve offered to contribute, now’s the time to step up to the plate (or crease if you’re from this side of the pond and prefer the cricket analogy).  The source is all in the contrib source repository and I’m happy for people to put their hand up for a section or subsection (hell, even a paragraph!) that is inadequately documented, needs reworking, proof reading – anything.

If you’ve ever wanted to get involved in Open Source this is going to be an easy entry point – and you get to learn even more which can help you get closer to the code!  Before I began the restructuring I had a reasonable idea of what I was doing with MonoRail, but now I feel like I know soooo much more…any hey – now I know how to work with DocBook too.

Anyhoo – I’ll be back in a couple of days.  If you want to help out drop me a line.  Until then…à bientôt.


Mar 22 2008

NHibernate Proxy Generator

Tag: NHibernate,Open SourceSymon Rottem @ 4:11 pm

I just stumbled over an interesting post on William C. Pierce‘s blog explaining how to set up NHibernate to run in a a medium trust environment and still get the benefits of lazy loading.

I’ve seen a few queries about how to do use lazy loading under medium trust in the past but have never really investigated it myself having assumed it was just one of those things you couldn’t do since proxies are generated through reflection and reflection permissions are not granted in medium trust environments.

Well it turns out that isn’t the case if you get a little creative.

What William has done is to create his own proxy factory that NHibernate can be configured to use so it will provide proxies that were generated at compile time where you have full trust rather than generating proxies at runtime where the reflection permissions are restricted.
He’s also provided a tool to generate those compile time proxies and released his hours of hard work as the NHibernate Proxy Generator (or NPG) so you don’t have to invest time of your own.  The project is still in it’s infancy but it’s released under the Apache License 2.0 so you can download the source and contribute should you so desire.

William has provided more information on how NHibernate can be configured to run in medium trust and use NPG generated proxies in his blog post so head on over there if you’re stuck with medium trust and still need lazy loading.


Mar 19 2008

DocBook MonoRail Docs in Contrib

Tag: Castle,Open SourceSymon Rottem @ 12:19 am

For those who don’t lurk on the Castle Development mailing list, the new DocBook version of the MonoRail documentation I’ve been working on has now been submitted to the Castle Contrib repository. If you want to download a copy of the source to build and play with you can find it here:

http://svn.castleproject.org:8080/svn/castlecontrib/documenation

This initial checkin contains only the MonoRail DocBook source files in their initial, unedited state, NAnt build scripts to generate the output and the toolchain required to do the build.

At this stage output generated includes single page HTML, multi-page HTML (one page per chapter) and a CHM file. I anticipate the addition of PDF and VS 2005 add in documentation formats in the near future. The following links provide a sample of the current generated output:

To build the documentation you will need to have a Java runtime installed, however you can easily use IKVM.NET as an alternative as long as you don’t mind making some minor changes in the build files. Each book can be built by executing NAnt against its build file (monorail.build for MonoRail, for example) or the whole tree can be built by using the default.build file. Keep in mind that right now there are only MonoRail docs, so either way it’s essentially the same thing.

Right now the content is only basically styled and only some code blocks have been set up for syntax highlighting. There are also likely to have been a couple of errors in transferring the data and several internal and external links are still broken. Since I have now got an initial buildable version in place I should be able to return my focus to fixing these and other content issues as well as continue work on migrating other frameworks in the Castle stack to the DocBook format.

Any feedback is welcome.


Mar 18 2008

DocBook in NAnt

Tag: UncategorizedSymon Rottem @ 10:10 am

Over the weekend I changed the way I’ve been building the new DocBook based documentation for Castle so that it’s more in line with normal automated build processes.

The process is somewhat new to me – I’ve never written an NAnt script in my life, so there’s been a bit of a learning curve involved…especially when trying to get do DocBook XSL transformations with syntax highlighting!

For example, take the following:

<exec program="xsltproc">
	<arg value="--output" />
	<arg file="${build.single.dir}/index.html" /><!-- file to output transform results to -->
	<arg file="customizations/html_chunked.xsl" /><!-- xsl to do the transforming -->
	<arg file="${source.dir}/book.xml" /><!-- xml file to transform -->
</exec>

This is a pretty straight forward NAnt exec task that’s running xsltproc.exe from the Win32 build of libxslt – an XSL transformation engine. Seems easy enough, right?

Ok, I chose this particular engine because I’ve chosen to make my DocBook files modular so I don’t have one giant XML file containing all the content. To do that I’ve used XIncludes and to make the engine support them all I need to do is add one argument:

<exec program="xsltproc">
	<arg value="--xinclude" />
	<arg value="--output" />
	<arg file="${build.single.dir}/index.html" /><!-- file to output transform results to -->
	<arg file="customizations/html_chunked.xsl" /><!-- xsl to do the transforming -->
	<arg file="${source.dir}/book.xml" /><!-- xml file to transform -->
</exec>

So good so far.

Where I ran into trouble was that I want to use the syntax highlighting in DocBook XSL – now things turn ugly. I can’t use my nice simple transformation engine anymore because the xslthl syntax highlighting library used by DocBook XSL is in Java and that means I need to use a Java based XSL transformation engine – I’ve chosen Saxon…but Saxon doesn’t support XIncludes out of the box. Aargh! Ok, there’s a way out of this, right? You betcha. You need to hook in Xerces so Saxon can use it for resolving XIncludes.

So, in summary, if I use Saxon, hook in the xslhtl package for syntax highlighting, then Xerces for XInlcude pre-processing to do what is otherwise the same as the task above the resulting NAnt task looks like this:

<exec program="java" useruntimeengine="true">
	<arg value="-cp"/>
	<arg>
		<path>
			<pathelement file="toolchain/saxon/saxon.jar"/>
			<pathelement file="toolchain/xslthl/xslthl.jar"></pathelement/>
			<pathelement file="toolchain/xerces-2_9_1/xercesImpl.jar"></pathelement/>
		</path>
	</arg>
	<arg value="-Dxslthl.config=file:///${project::get-base-directory()}/customizations/highlighters/xslthl-config.xml"/>
	<arg value="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
	<arg value="-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
	<arg value="-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration"/>
	<arg value="com.icl.saxon.StyleSheet"/>
	<arg value="-o"/>
	<arg value="${build.single.dir}/index.html"/>
	<arg value="${source.dir}/book.xml"/>
	<arg value="customizations/html_single.xsl"/>
</exec>

Personally I think this is scary – there must be an easier way to do DocBook transformations that won’t cost you. Does anyone have any suggestions?

As a side note, if you want to do all of the above without installing Java the above task can be executed using IKVM.NET as described in my last post.


« Previous PageNext Page »