DDD8  was a lot of fun!
I really didn’t know what to expect and it turned out great, and got to a few talks ( not as many as I wanted tho) and met personally a lot of really interesting people.
Moving on swiftly to the meaty bit of the post:
I’ve  uploaded the code and slides to github, I m hoping I can improve this samples with time, if there is anything wrong apologies in advance, first time using git as a committing to a project so I m bound to get it wrong. Looking forward to James Gregory E-Van on git so I can learn more on the topic :) .
I’m sure I ll look at the code sometime later and think OMG! how did I dare to present this in public, but I guess is the nature of the beast :) .
If you saw the talk please let me know what you think, as I would appreciate any feedback, particularly the parts that I can make better. So far I the feedback I have is:
  • I do speak too quick,
  • I should talk about legacy code and how to deal with that
I posted the code in the same way I presented it, this means there is a OrderService_version1, 2 and 3, hopefully you can follow the code pretty much as we did it in the talk.
There was some  questions, and I said I ll post some links here:
Books:
- The Art of Unit Testing (Roy Osherove),  the talk is heavily inspired by this book
- xUnit Test Patterns, Refactoring Test Code ( Meszaros), Great book if you are looking for more detail. Perfect as a reference book
- TDD by Example by Kent Beck, a very hands on approach highly recomended.
- Working Effectively with Legacy Code, Michael Feathers – A must read if you are interested in testing (whether you are working with legacy code or not).
Tools:
During the talk I was using
Unit testing frameworks:
Mocking Frameworks:
Other tools  mentioned:
-Rhino  Mocks: Possibly the most used Mocking Framework
-NCommon: General purpose library, definitely worth a check
-Ninject: IoC container ( there is also .. Ninject.MVC that helps you wire up the dependencies of your controllers on they fly, very useful )
-Windsor: IoC container
If there are any questions or comments, please do let me know
Thanks to the organizers and everyone there, it was a wonderful experience that I m hoping to repeat.
Cheers

I m planing on a series of blogs on WIF ( windows Identity Foundation) however that might or might not happen :) , so meanwhile I  m posting this, StarterSTS is as the name implies a starter sts something to get you started on the world of Federeation Identity , claims and all that lovely stuff.

You can find a video about all this steps in the codeplex site to starter STS, however there are a few differences between what you can see in the config files there and whats in 0.95 ( this is what I’ve used)  .

I tried this on a Windows 7 and a Server 2008 machine

1) Get the sources from codeplex and copy them over somewhere. create a web app that points to it
2) Create a new app pool ( not necesary but nice to be able to see what is happening)
3) Install WIF (used to be called geneva framework)  latest binaries available here
4) Download and install SQL server express,or if you have a ssql server there happy days :D
5) Create a self signed cert and add it to the default web site , then go to default website and add the certificate to https with Bindings options
6)  Add read access to the Network service account in the folder where you put the sts sources
7) Run mmc -> add snap in and get the cert thumb print , also set the network service read permisions by right click Manage Private Keys…
8) Open the file config/Certificates.config and change the thumbprints of the certificates ( initialliy they are all the same , the last one RP, should be the thumbprint with all spaces removed) (you can get the thumbprint of the certificate in mmc ->certificate ->properties -> thumbprint)
9) Run aspnet_regsql ( to create the asp.net membership provider aspnetdb) (This program is not in the path, so you ll probably have to go to C:\Windows\Microsoft.NET\Framework\<your version of the .net framework, if in doubt go to 2.0>>aspnet_regsql )
10) Create some users from IIS Maanger.
11) If you are going to be using from somewhere other than localhost:

  • The self cert you provided must be added to your the trusted providers( whereever you are using this)
  • when you are using fedutil make sure teh references to the federationmetadata.xml points to your server and not localhost ( i seen this happening more than once)

12) On the application side of things Add STS reference…
13) you might need to tweak the startersts.Config


If you are trying to use Ninject with Asp.net MVC, there is an integration available in github
http://github.com/enkari/ninject.web.mvc if you look at the code there its just 3 clases, but
the fact that its been used by much more people than just myself makes me a bit more confortable because
I m not terriby familiar with Asp.Net MVC. Please note I m not too familiar with Ninject either
If there is anything that can be improved, I m all ears.

Anyway, this is the integration working, using Ninject 2, I tried this with MVC 1 and 2 and they both worked.

Obviously get the code from the Github repository and build the solution in release mode, add them to your
project.

Then in your Global.asax.cs you need to do your implementation of   CreateKernel, and a really important step,
to register all your controllers, to do that just override the OnApplicationStarted with RegisterAllControllersIn(“SomeAssemblyName”)
as in the example there in github.

If you are not familiar with ninject you ll need to look at defining your Modules as well, something like

private class MyWebAppModule : NinjectModule
{
   public override void Load()
  {
      Bind<ISomething>().To<Something>();
......
  }
}

Oh yeah, for some reason, kernel.AutoLoadModules() doesn’t work for me, its not a feature I m interested in at the moment but …

and you can use that module to create the kernel, there are other ways to use Modules but that worked for me
on my todo now is to understand why you would use one way over the other to create and work with modules
and what modules actually are.


Ext Js bits

20Oct09

Just some interesting thing I found on the extjs world.

I m only looking at stuff working on ext3.0

In ExtJs the JsonStore has paramNames this Object contains 4 properties

{
    start : 'start',  // The parameter name which specifies the start row
    limit : 'limit',  // The parameter name which specifies number of rows to return
    sort : 'sort',    // The parameter name which specifies the column to sort on
    dir : 'dir'       // The parameter name which specifies the sort direction
}

This properties are the default however they can be changed by using a configuration property or to change globally
it should be changed in the store prototype

Drag and Drop into a grid

Shea Frederick has a very nifty Excel drag and drop into the grid, got the code
and runs in ie7, ie8, ff3.5 and Chrome and you can get it here


Had a brilliant weekend up North in @barcampderry Met some interesting folks and had a chance to discover a fantastic city and the surrounding area.

As promised these is the slide deck for the presentation, I don’t think these are of much use but please feel free to ping me on twitter or as a comment here if you have questions or comments.

Cheers


The Art of Unit Testing (by Roy Osherove) First Meetup

Its amazing how much you can talk about just one chapter, ok we diverged at some point to related topics, we dreamed about our own Open Source project, again. Anyway, these are my thoughs about the first chapter, after the meeting

Integration testing and unit testing:  I end up thinking:

  • You shouldnt do it inadvertedly.
  • Its your responsability as as developer to do certain Integration tests (if you want to make sure that certain services are working as expected, that certain dependencies that you have and you are ok with that are working as expected)

We also mentioned the Demeter Law when talking about building APIs.

Again this inspired me to look at StoryTeller. Some resources I found:

I m now looking at the samples from it but that ll be in other post :)


We are meeting for the first time for the Book club and just to get the ball rolling on this I though I’d write up a mini summary of chapter 1 on The Art of  Unit Testing before the meeting as a way to explore the concepts and then another one after if necesary.

So far I like the book, a very clean and concrete explanation of the basics, in plain english.

Some concept definitions are opinionated, but  Roy does a good job of it by telling you that there are many defintions available of certain terms, he then tells you wich one he will be using, for example when he defines Legacy Code he setteles for: Code that has no unit tests ( in line with M Feathers), he gives you a few other options including one that kept sticking in my head: Code that works. (quite possibly with bugs , I cant help to add).

He makes a lot of emphasis in Good Unit Tests, as tests that are automated, repeatable, easy to implement and read, that are trustworthy and run quickly, normally written using an unit testing framework.

I think a knock on effect of this is that the tests will be just a few lines long and quite likely many.

The definition of Integration Tests made me think a lot. For reference: Integration testing means testing two or more dependent software modules as a group.  I’d really like to discuss this with the group tomorrow today, I’d say many of us do more Integration testing that we tend to think? particularly if we have a dependency on a service that has no other hard dependencies ( like a db, I/O operations or similar)   — Will update on this.

Another good concept to be introducing at this early stage is the Regression, and when I was reading this I was thinking It’s so great to tie this up with CI, why? Well if you have relevant test coverage and you change something (adding the required unit tests and all ) you commit your code , the build machine will immediately go and try to build and run your test suite, so that will help you to know if potentially you have a regression.

He outlines a series of questions to ask yourself  to find out if you are writting good tests the one I liked the most is this one:

Can I write a basic test in no more than a few minutes? — Will update on this too later on.

There is a  unit test example without using a  framework, I liked it  first because of this little snippet that I didnt know about: MethodBase.GetMethod().Name , more to the point I think hes trying to highlight the advantages of the frameworks and also because it reminds you of the fact that you dont need unit testing frameworks.

Then there is a basic intro to TDD, where the last D stands for Development , and thats ok, I have not much more to add because I didnt find anything that sticks out .

So far so good, I think we could have jammed the first two chapters in this meet up.

Comments, corrections and questions as always welcome :)


Very excited by a very very busy few months ahead:

- This wednesday thursday and Friday  Epicenter, In dublin where John Skeet, Craig Murphy (the man behind the DDD events), Barry Dorans, Barry Carr  and many others will be talking, including me :) . Sounds like a busy conference full of choices.

Oh yeah! and Craig Managed to get a Special Offer on Epicenter,  buy 1 day get 3. More here

- September Dublin Alt Net meeting. 15th of September. New location Seagrass we ll be doing some lightning presentations on  Kanban, Mono and Fluent NHibernate ( a bit of a mixed bag) more details to follow in dublinalt.net

- OSSBarcamp, this is one not to miss, the  19th of September all things open source. ONe takl i m particularly interested in is the one on IPython, I really hope I can make it at least to that talk.

- Finally  the 30th of september  Sebatien Lambla istalking about Open Rasta , finishing arrangements as we speak, this is the first urregular Dublin Alt net meet up =). Location will probably be Seagrass too. More info to follow in Dublinalt.net

Cheers


Just a quick post :

If are trying to use Format, in GWT, String.Format  is not supported, instead you should use Format a lot of interesting stuff there, so if you are using GWT-Ext take 5 min of your time and have  a look, you ll end up using it.

This is what I m using for Strings and for dates


Nvelocity help

05Aug09

Hi there

I ll just add this because I saw some people being directed to here when searching for NVelocity docs (no idea why tbh)

Anyway here is the link to the Appache documentation for velocity

Also of course the castle docs