Welcome to Manicprogrammer Sign in | Join | Help

Stormwind.Accuracy - Community Feedback

I know I haven't blogged in a long time, and I didn't intend to break the ice so soon, but I have some acknowledgments to make.

First of all I'd like to say that the feedback I'm getting on Stormwind.Accuracy is brilliant! People are really loving it. That's as much as I could ask for. You can keep track of the things we'll be implementing in the future in Stormwind.Accuracy's Jira.

Even though I couldn't ask for more, more is coming!

Thanks a LOT Martin Nilsson for all the feedback on Accuracy and for the patches you submitted for it. I really appreciate and I'm pretty sure you just helped the whole .Net community by doing so (I hope people will find as much value in Accuracy as the ones I heard of have).

We got more patches, but I'm not sure I'm allowed to name them here, since they don't have blogs and stuff. Anyway, THANKS A LOT, you know who you are! You just helped make something great even greater!

Now the part where I ask for help (It seems I'm always asking, huh?). People, we are in real need of help with Accuracy's wiki. This is a great opportunity for you to get more acquainted to this amazing Acceptance Testing framework AND help the whole community! Win-win, huh? Hope to hear from you guys soon!

Cheers,

Bernardo Heynemann

Posted by heynemann | 0 Comments

Book, Book blog and YES I AM ALIVE

I know it has been a long time, but I have been doing several things at the same time.

One of them is the reason for this post. I've started writing a book on reducing friction.  Friction meaning the kind of things that slow down software development projects, specially focused on agile practices.

You can read more about the book and keep up-to-date with the books development in the books blog at: http://reducingfriction.wordpress.com/.

I hope I get feedback from you guys on what would you consider friction and what would you like to add to the book.

The partial list of topics and sub-topics of the book is published at the book's blog at http://reducingfriction.wordpress.com/books-topics-and-sub-topics/.

What about Stormwind? There's some stuff in the pipeline that I'm working in as well as the other committers. I'll talk about that later.

Cheers,

Stormwind.Accuracy 0.3.0 - GRAB WHILE IT'S HOT

Hey my three readers? How have you guys been? Hope you're good! :)

It's that time again! The time when I come back from a long "non-writing" period. Usually when I'm not writing blog posts it means I'm working on something. This time I've been working in a couple things, though.

The one that matters for this post is Stormwind.Accuracy, our shiny and fancy Acceptance Testing Framework.

Release 0.3.0

After delaying this release way more than I should, I've finally reached a point where releasing it makes sense. It's stable enough (we've been using it in some projects and I received some e-mails of people using it), it has a bunch of new features, and improved speed.

First let me put here the Release Notes (which you can read here):


Release Notes - Stormwind Accuracy - Version 0.3.0.0

Bug

Improvement

New Feature

Task


Now that you got the release notes you know what I've been working in. The most interesting bit is the last one: "Update WatiN version".

Updating WatiN Version and a Blazing Fast Accuracy

This was very interesting, since the new WatiN introduces some breaking changes, and now all the elements have interfaces (IButton, ICheckBox, you get the idea). This is a LOT better, since then I can have my BrowserDriver working with interfaces.

The main upgrade Accuracy got was in speed of execution. When changing the way WatinBrowserDriver used WatiN, I decided to do a major refactor on the way that WatinBrowserDriver was designed. This allowed me to fine tune a lot of the pain points that I had with WatiN and apparently the whole framework is more stable now (no more failing builds after the refactoring!!!).

This comes to prove that you should optimize any time you feel the pain, but ONLY THEN, never before. I might never have gotten to the point that Accuracy is now if I tried to over-optimize in the beginning.

Fluent Interface - I.Can.Do.A.Lot.Of.Stuff

Yeah, yeah, I know you guys only care about new features, so as you can see in the Tickets there are a lot of newly added syntaxes. I'm pretty sure that we are still light-years away from covering most scenarios. So if you have one scenario that we haven't covered and would like to create a new action for it, please DO, and then send us the patch! :)

Just so you guys know, here's the upcoming features for 0.4.0 (something you want might already have a ticket, so you might as well vote in it):


Release Notes - Stormwind Accuracy - Version 0.4.0.0

Bug

Improvement

New Feature


If you don't feel like implementing something you need and would like help from us, WE ARE GAME! Just create a new ticket in JIRA and we'll try our best to help you out!

The Goodies

As usual, the release comes with updated binaries, references and source.

So, if you are using, would like to use, or just wanna see what all the fuzz is about, GO GRAB THE LATEST VERSION here!

See ya guys,

Stormwind Project - Maturity Point

I've been doing Stormwind work since 4th September, 2007. The projects we are managing in Stormwind started around the beginning of 2006, though. It's been a very rewarding experience all over.

When we started (me and Claudio Figueiredo), we were not aiming at something as big as what we have now.

I just wanted to do a brief summary on the whole experience before it gets lost in the midst of time.

Childhood

When Stormwind started, we were very worried about the actual infrastructure for the community, like forums, portals, build server, e-mail, domain and stuff like that. These are very time-consuming to get right.

We fooled around with several different web portal solutions for our main page, until we settled with Joomla. It kind of gets what we need done, but we would like it to be a bit more extensible. There is right now a project called Stormwind.Fjords which aims at being a more extensible web portal for the .Net platform.

This is the point at we turned to some companies for sponsorship. Handling an open-source community is very expensive if you think about time consumption alone. Now, imagine if you have to pay for all the resources involved like:

  1. Web Hosting - This is a very expensive resource, since depending on your community activity it can involve a lot of trafic.
  2. Source Control Management Hosting - Another expensive resource, since if you have active committers that means a lot of trafic and even more disk space in the SCM provider.
  3. Build Server - Another expensive resource, since for this one you need a Server to keep building code. We were lucky enough as to get a Virtual Private Server that's available all the time.
  4. E-mail and Lists - This wasn't expensive since we got Google apps for your domain and google groups. Thanks google!

After setting all this up, we had to crank some code. At this point we wanted to build NMVP 1.0.0. Right now, I'm glad we didn't. C# didn't have the language constructs required to make NMVP work the way we envisioned it at the time (it does now, though!). We spent a HUGE amount of time here making our build scripts work.

Young Adulthood

I think this is the phase we are now.

We have very stable infrastructure, featuring:

  • Email groups
  • Subversion Server
  • JIRA Bug tracking
  • Confluence Wiki for documentation
  • Web Portal for general information
  • Fisheye and Crucible for Code Review
  • Several sponsored licensed software like: CCNet plugins, Resharper, Mingle, among others

We have several projects featuring releases that are stable enough for production use. This is actually a major turning point for me.

We finally arrived at a point where all our efforts are being turned in actual value for the development community in general. This is a sign that Stormwind has reached a more mature age. An age where we'll start focusing more in WHAT to deliver instead of HOW to do it.

A proof of this maturity is that yesterday we applied our first community-contributed patch. This does not sound like much to the likes of Castle or NHibernate, but if you ask their committers you'll see how hard it is to get real, constructive involvement from the community. That really makes me proud to be part of this effort and makes me want to deliver more and more fun stuff.

The Future

We have several projects running and we are trying to get Project Managers to contribute helping us be more organized, yet still agile as an open-source community should be. More on that in another post.

We are looking forward more interaction with the community and releasing more features for our projects. We also need to work heavily in our documentation. So there's a lot of work ahead. I don't think we could be more confident that we can do it, though.

It's been a thrilling experience all along, and I'm sure it's still going to be for a while.

Conclusion

This was just a quick summary of where we are now in Stormwind.

If you think any of our projects is interesting and want to be a part of it, just let me know. Send me an e-mail, comment here, send e-mail to Stormwind Community Dev group (stormwindcommunitydev@googlegroups.com).

I can tell you from experience, when you make a difference in an effort that big, it really pays every single minute you put into it. Really.

Posted by heynemann | 0 Comments

WCF Service Extreme Make-over - Part 3

IMPORTANT: It's really important that you read part 1 and part 2 before reading Part 3. I'll assume you did, so a lot might not make any sense unless you've read it.

Introduction

So in the previous two posts, we've established how we wanted to use and host our WCF Services, and how we actually hosted them.

Just some things to remember:

  1. Our Service should be usable by it's URL alone, which is configured using an AppSettings value with Key of "IMathServiceUrl".
  2. We want to access this service using var mathService = ServiceResolver.Resolve<IMathService>();

So, without further ado, let's have our service working. Oh, wait... Almost forgot I work for ThoughtWorks now. So let's have a failing test.

The very beginning - Our Failing Test

Let's have a test that calls on our Math Service, like this one:

[TestFixture]
public class TestServiceCall
{
    protected IMathService mathService;
 
    [TestFixtureSetUp]
    public void TestFixtureSetUp()
    {
        mathService = ServiceResolver.Resolve<IMathService>();
    }
 
    [Test]
    public void ShouldCallAdd()
    {
        Assert.That(mathService.Add(1, 2), Is.EqualTo(3));
    }
}

As you can see we initialize an instance of IMathService in our Fixture SetUp, and then just use it whenever we want it. Let's check the config file for the Test Project, just to make sure we are not using any WCF sorcery:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <appSettings>
    <add key="IMathServiceUrl" value="http://localhost/MathService/MathService.svc" />
  </appSettings>
</configuration>

As promised we are just setting the Url for that service's endpoint. Let's run our test and check that it fails.

The actual Service Resolver

Cool, it doesn't even build, since it doesn't know any ServiceResolver classes. So let's change that by adding a ServiceResolver class to the ServiceInfrastructure project, like this one:

using System.ServiceModel;
 
namespace Stormwind.EasyWcf.ServiceInfrastructure
{
    public class ServiceResolver
    {
        public static T Resolve<T>()
        {
            return ChannelFactory<T>.CreateChannel(
                new BasicHttpBinding(),
                new EndpointAddress(UrlHelper.GetUrlFor<T>()));
        }
    }
}

What? That's it? I'm sure you must be mistaken!

Not at all my dear friend, and you can thank the WCF Team for that. They made it very easy to create a client-side proxy using code, instead of a Service Reference.

Now, let's run our test again, and who could foresee it! GREEN!

Conclusion

That's all there is to it, though. Even though I would like to keep rambling on and on about how hard it is, it wasn't even hard. I just had a hard time finding resources that explained the whole process. That's why I decided on writing a comprehensive post on it.

I really hope that these three posts have helped you grasp how to use WCF in a more developer-friendly way. I'll post next on how to do secure bindings and stuff like that using this approach, which is quite good to ENFORCE security, since the client and host cannot mess with the security settings. Once again, it has drawbacks on flexibility.

The full code for Stormwind.EasyWcf is available through our Subversion server at: http://svn.stormwindproject.org/svn/Personal/Heynemann/Stormwind.EasyWcf.

Cheers.

Posted by heynemann | 3 Comments
Filed under ,

WCF Service Extreme Make-over - Part 2

IMPORTANT: It's really important that you read this post before reading Part 2. I'll assume you did, so a lot might not make any sense unless you've read it.

Introduction

Ok, in last post we decided on the following desired features for our WCF Services:

  1. No more Service References and we'll share contract assemblies between client and host.
  2. No more funky XML Config files that span multiple screens.
  3. Calling services should be simple and straightforward, with as little configuration as possible.
  4. Hosting the services should be easy and require as little configuration as possible.

We also decided on some assumptions that need to be true in order for our scenario to work in the way we intended:

  1. Well-defined policies on communication between services.
  2. Well-defined boundaries between services.
  3. Contracts shared between client and host (and versioned).

We have some degree of variability for those constraints in our solution, but for the rest of this post I'll assume them to be true.

Service Infrastructure

First thing we'll do is create a service infrastructure project in our solution to hold all our infrastructure code (the actual purpose for this post).

I'll call it Stormwind.EasyWcf.ServiceInfrastructure, and add it as a Class Library.

So, without further ado let's create our WCF Service.

MathService Host

We'll start with the contract for our service. This will be a very simple contract with just one operation that goes like this:

   1:  namespace Stormwind.EasyWcf.Contracts
   2:  {
   3:      [ServiceContract]
   4:      public interface IMathService
   5:      {
   6:          [OperationContract]
   7:          int Add(int value1, int value2);
   8:      }
   9:  }

That is fairly common WCF stuff, right? We'll add that class to our Stormwind.EasyWcf.Contracts assembly. This is a new project which we'll add to our solution, and is responsible for holding all our contracts. This is the "currency" we'll use when having clients talking to hosts.

Now we just need to implement that contract. There are two approaches here. One is creating the implementation for it in the Web App that hosts the service. The other approach is to have an assembly of service implementation that you can version independently of the web site. I like the later one better than the former.

So we'll just create another class library called Stormwind.EasyWcf.Implementation, and add to it our MathService class, like this:

   1:  using WCFFacilityTest.Contracts;
   2:   
   3:  namespace Stormwind.EasyWcf.Implementation
   4:  {
   5:      public class MathService : IMathService
   6:      {
   7:          public int Add(int value1, int value2)
   8:          {
   9:              return value1 + value2;
  10:          }
  11:      }
  12:  }

Ok, again pretty straightforward. Now we have both our contract and our implementation. All that's left is hosting the service. That's should be easy, right? Well, after we get the infrastructure out of our way it actually is.

WCF can automatically host the services in IIS for you provided you supply it with some configurations (config files) and a service file (*.svc) so that it can serve as a hook for IIS to call on the ASPNET_Isapi.dll and then delegate the call to WCF.

That's all fine and dandy IF you want to use config files, which is not our case. Fortunately for us, there is another way. WCF allows us to specify our own ServiceHost factory. What that means is that we can specify how our service is to be hosted, instead of relying in the default one.

In order to host our service using that approach we'll rely on our own implementation of the ServiceHostFactory class. This class is responsible for building our own ServiceHost via the CreateServiceHost method. This method gets a service and a bunch of urls. We're only interested in the service. We'll add a class called DefaultServiceHostFactory to our ServiceInfrastructure project like this one:

namespace Stormwind.EasyWcf.ServiceInfrastructure
{
    public class DefaultServiceHostFactory : ServiceHostFactory
    {
        public override ServiceHostBase CreateServiceHost(string service, Uri[] baseAddresses)
        {
            var implementationType = Type.GetType(service);
            var contractType = GetContractFrom(implementationType);
            var serviceHost = new ServiceHost(implementationType);
 
            serviceHost.AddServiceEndpoint(contractType,
                                           new BasicHttpBinding(), UrlHelper.GetUrlFor(contractType)); 
            return serviceHost;
        }
 
        private static Type GetContractFrom(Type serviceType)
        {
            var contract = serviceType.GetInterfaces().Where(type => type.IsServiceContract()).SingleOrDefault();
            if (contract != null)
                return contract;
 
            throw new InvalidOperationException(string.Format("The type {0} is not a service. Try using the ServiceContractAttribute.", 
                serviceType));
        }       
    }
}

Let's take it slow. Before I start commenting on the code above, let me show you how we would use that in a MathService.svc file:

<%@ ServiceHost Language="C#" Service="Stormwind.EasyWcf.Implementation.MathService, Stormwind.EasyWcf.Implementation"
Factory="Stormwind.EasyWcf.ServiceInfrastructure.DefaultServiceHostFactory, Stormwind.EasyWcf.ServiceInfrastructure" %>

So in the service declaration you can see that we're specifying the ServiceHost factory to use for this service. This is how WCF knows how to build the service host for this service.

If we go back to the DefaultServiceHostFactory class, you'll see that the CreateServiceHost method gets the service that is trying to use this factory as a parameter. That string is the one supplied in the .svc file in the "Service" attribute, in our case "Stormwind.EasyWcf.Implementation.MathService, Stormwind.EasyWcf.Implementation".

From this string which is the full name for our service implementation we can get to a type, represented by the implementationType variable. From that we can get to the contract easily by inspecting the interfaces implemented by the "implementationType" type. The GetContractFrom method uses an extension method defined in the class below:

using System;
using System.ServiceModel;
 
namespace Stormwind.EasyWcf.ServiceInfrastructure
{
    public static class TypeExtensions
    {
        public static bool IsServiceContract(this Type type)
        {
            var attributes = type.GetCustomAttributes(typeof(ServiceContractAttribute), true);
            return attributes != null && attributes.Length != 0;
        }
    }
}

This class just defined a method that returns if some type contains the ServiceContractAttribute, which is the one that defines a WCF Service Contract.

After retrieving the ContractType, we can just define our ServiceHost. In this sample we're just using a BasicHttpBinding, but you can use any binding you want. We also applied a Convention-Over-Configurations concept that defines that we need an AppSettings value that defines the URL for the endpoint using "Contract Name" + Url, in our case "IMathServiceUrl". So after defining that key in our web.config file for the Web App, we are set. We have a ServiceHost that can handle requests properly.

If you want to try it out just attach your VS to ASP.Net and access the SVC file's url from your browser. Remember to put a breakpoint in the ServiceHostFactory to see how it is hit.

Conclusion

Oh no, not again!

Sorry, this is bigger than most people would read already. If you still feel like reading and would like to know how to USE this hosted service just go to Part 3.

Cheers.

Posted by heynemann | 1 Comments
Filed under ,

Have control over both ends for WCF Service? Or just enforcing security and behavior? - WCF Service Extreme Make-Over Part 1

Introduction

So, WCF is a pretty standard way of using remote calls in .Net at this point.

The general usage pattern that we've seen around is:

  1. Create a WCF Service Application (usually ASP.Net) to be the host
  2. Create the service contract
  3. Implement the service
  4. Add a Service Reference to the client, which in turn creates a Proxy (A.K.A. Frankenstein)

While there's nothing wrong with this approach, I've worked in several projects where the team tried to implement a SOAish(links to a presentation on Guerrilla SOA from QCON San Francisco) approach to the client's integration points between different applications.

I don't know why, but every single time the team chose the Ad-Hoc approach and implemented all integration services using the recipe above (and rinsing and repeating of course).

Once the service biosphere starts growing and the interactions become trickier, teams started facing configuration hell to have the services working together, in a secure way, in several environments (Dev, Test, UAT, Prod, etc).

With that in mind, why don't we try something different the next time?

Why Proxy something you know so well?

One of the problems that arise from the previous approach is versioning service libraries. I am aware that there are versioning mechanisms that could be used, but remember, I'm reaching for easier approaches, not more complex ones.

Some things to bear in mind:

  1. This scenario doesn't account for any external access to the services (I guess it wouldn't be hard to do it, though)
  2. The contracts are shared by host and client
  3. The urls and endpoints for services are well-known among the organization and their management is centralized.

Given that, why have proxies to something if you can share the contract and never have to care about the implementation?

So let's settle for that: NO MORE SERVICE REFERENCES AND SHARED CONTRACT ASSEMBLIES.

Xml: Readable? Really?!

Don't get me wrong here. I think the configuration schema for WCF Services is brilliant, in that it completely decouples the implementation of the service from the way it is to be exposed to clients.

I just have been burnt several times before by incompatibilities of configuration between clients and hosts, and maintenance issues with XML Configuration files for WCF Services when you have many of them (think 5 services being called in the same web site).

Now wait on a second... Is there an easier way of configuring your services without resorting to Xml Config sorcery? Yes and No.

If you have well defined policies of communication between services and well defined boundaries between them, then a big resounding YES. Otherwise, no.

Since I am assuming all the above holds true, we'll settle on one more thing: NO MORE FUNKY XML CONFIG FILES THAT SPAN MULTIPLE SCREENS.

Call to service must be transparent (or at least translucent)

Ok, so if we don't have service references than we'll manually create the dependencies and proxies and bindings and...NO... please don't. If you have to resort to all that then we should stick with the proxy.

Instead of taking the approach of how we'll do it, let's try and see how we would like to call it.

Say I want a service called "MathService", which is identified by the contract IMathService, that has one operation int Add(int a, int b) (you can figure out what it does, right?).

How would we like to use that service? Well, in the well-known way of the IoC Containers would be nice:

IMathService service = ServiceResolver.Resolve<IMathService>();
var result = service.Add(1, 2); //And have result being 3.

Now wait just a second, mister. That is ridiculous! I'd even go as far as saying it's preposterous! Where are all the endpoints? All the bindings? All the urls and implementations? And proxies?

Ok, you can say that now, but just hang tight and let's settle on: HAVING A VERY SIMPLE AND STRAIGHTFORWARD WAY OF CALLING SERVICES, WITH AS LITTLE CONFIGURATION AS POSSIBLE.

Hosting the service should be painless

So, hosting a service is pretty easy, right? You just slap a MathService.svc file there with the service name and a bunch of configurations in web.config.

How about we try to figure out a different way of doing that. What if we don't use any configurations in web.config other than the url for the service? Hmm... that sounds good actually. Let's try achieving this:

Service (svc) file:

<%@ ServiceHost Language="C#" Service="Stormwind.EasyWcf.Implementation.MathService, Stormwind.EasyWcf.Implementation"
Factory="Stormwind.EasyWcf.ServiceInfrastructure.DefaultServiceHostFactory, Stormwind.EasyWcf.ServiceInfrastructure" %>

Web.Config file:

<?xml version="1.0"?>
<configuration>
  <appSettings>
    <add key="IMathServiceUrl" value="http://localhost/MathService/MathService.svc" />
  </appSettings>
</configuration>

Are you sure we can do that? Where are all the <serviceModel> stuff? Hmm... We got rid of that. We'll see later on how to do it.

So let's settle for: EASY HOSTING OF SERVICES WITH AS LITTLE CONFIGURATION AS POSSIBLE.

Conclusion

Oh no! You gotta be kidding me?! Conclusion?! You didn't show anything!!! Just asked a bunch of stuff and answered yourself, promising something cool!

Yes, you're absolutely right. I know I did that. I'm just getting you ready for the WCF Service Extreme Make-over post, Part 2.

Just bear with me and I promise you won't regret it!

Cheers!

Posted by heynemann | 2 Comments

Asp.Net Action Filters - Can't test them? Stormwind comes to your help!

Once more my friend Claudio Figueiredo amazed me coming up with a brilliant solution to a problem that was starting to shadow an otherwise brilliant implementation of the MVC Pattern.

The new ASP.Net MVC Framework allows you to specify Action Filters. You can learn more about them in his post here (and check his solution to this problem as well).

These Action Filters are brilliant, in which they allow us amazing possibilities like logging actions when needed, caching Action Results, or anything that you can think in the ways of intercepting action calls.

The problem is (well, was) that they're not testable per se. The issue here being that currently the MVC Framework will not call them when you just create your own Controller in your test and call the action directly (which kinda makes sense).

So Claudio came up with a clever way of mimicking ASP.Net MVC's calls of the ActionFilters. If you call the action using his extension method, you'll get all the goodies that you would normally get from the framework.

Enough of reading my post! Go read his now!

Posted by heynemann | 1 Comments
Filed under , , , ,

Expression Tree + Reflection + C# 3.5

I've been trying to do something like this since C# 1.1.

Tonight I got to do it:

SomeCode.DoSomethingInProperty(cust => cust.Orders);

My problem has always been that I couldn't (using delegates before) get what property you want to use.

I could resort to reflection trickery and use the string property, but that's just not Refactoring friendly, now is it?

Today I learned how to it (using this article as reference: http://blog.naxsoft.com/archives/488/reflection-on-c-35). Here it goes:

public string PropertyBeingAssigned(Expression<Func<T, object>> property)
{
    if (!(property.Body is MemberBLOCKED EXPRESSION)
        throw new InvalidOperationException(
            "Wrong type of Expression. This method only takes the property you're assigning the elements to.");
 
    var member = (MemberExpression) property.Body;
    var name = member.Member.Name;
 
    return name;
}

Conclusion

As much as people say that the new C# is just syntatic sugar, I couldn't disagree more. The new features enable scenarios that once we only dreamt of.

What exciting times to be a .Net developer!!!

Edit

PS: Apparently Community server blocks the word MemberExpression for some reason. Just get it fixed in the "if (!property.Body" code

Posted by heynemann | 1 Comments
Filed under ,

That's the company I work for - WOW!

My good friend Claudio Figueiredo just pointed me in the direction of this pearl.

Things like that look like just some random guys in ThoughtWorks being funny, but it isn't.

I have worked for TW for 5 months now, and I don't see myself working for another company ever again (at least not in the foreseeable future).

The dynamics we have in the company, the amazing value that we deliver to clients every iteration (or week if you will) and the INCREDIBLE people that work for this company, just make me like it even more!

Bravo, Matt for this amazing video! http://manicprogrammer.com/cs/blogs/claudiofigueiredo/archive/2008/07/05/when-fiction-imitates-life.aspx if you'd like to check it out directly.

Cheers,

Posted by heynemann | 0 Comments

Want to check ASP.Net MVC out?

My good friend Claudio Figueiredo is writing a superb series on all sorts of stuff on the new ASP.Net MVC.

I definitely advise anyone interested in it to check the posts out.

So far he's blogged the following posts:

  1. ASP.Net MVC Experiences
  2. ASP.NET MVC Experiences - Part 1, The Setup
  3. ASP.NET MVC Experiences 2, Overview

I'll keep checking the series and post here whenever he updated it.

Good job, man! Keep it up!

#160

Posted by heynemann | 1 Comments

NRoR or IronRoR?

Now that's good news!

#159

Posted by heynemann | 0 Comments

Asp.Net MVC Release 3

Yes, I am late in my blog reading, but I gotta tell you guys, after reading Scott Gu's blog post on Asp.Net MVC I was more impressed than I imagined I would be (read it here).

There are so many features I'd love to have at the projects I'm working on right now. I'm even considering converting a MonoRail project I have into an Asp.Net MVC one.

One thing I couldn't figure out yet is this new MVC integration with IoC Containers.

I mean, when using MonoRail the integration with Windsor makes it easy to resolve controllers from the container, which means I can just ignore the dependencies, and things just work.

So if my ControllerA depends on ServiceA, ServiceB and RepositoryA, I just declare variables for those three dependencies and initialize them in the constructor. Everything works as expected.

How would I do that in the new Asp.Net MVC Framework.

Cheers,

#158

Posted by heynemann | 2 Comments
Filed under , , , ,

Table Height of 100%?

Want to have a table with 100% height and not sure how to do it?

JQuery comes to the rescue!!!

Just do it like this:

<html>
<head>
    <script type="text/javascript" src="yourScriptPath/jquery-1.2.6.min.js"></script>
    <script>
        $(function(){
            function refreshTableHeight(){
                var windowHeight = $(window).height();
                $('#mainTable').height(windowHeight);
            }
        
            refreshTableHeight();
            
            $(window).resize(function(){
              refreshTableHeight();
            });
        });
    </script>
</head>
<body>
    <table border="0" cellspacing="0" cellpadding="0" width="100%" id="mainTable">
        <tr>
            <td>Some text</td>
        </tr>
    </table>
</body>
</html>

And JQuery will keep the table 100% even if the window is resized.

This only works in the latest version of JQuery (1.2.6) or if you use the Dimensions plug-in for other versions.

Cheers,

#157

Posted by heynemann | 2 Comments
Filed under ,

Stormwind.NMVP

This week I learned that there are still people using NMVP, which is really cool.

One of those people asked me if I would release another version of NMVP soon. Well, I'm not sure how soon, but there are plans of releasing an improved version of NMVP.

To make things easier on users of NMVP to communicate with the team, we've set up two channels.

Wiki

We've set up a wiki at http://using.stormwindproject.org:8081/display/nmvp/Home. It's still very incomplete, and it's just a place where you can see the Vision Statement for the next release.

Please comment on that using the wiki or send mail to Stormwind Dev list.

Jira

If there's some feature you'd like to see implemented, or some annoying bug you'd like to get rid of, just let us know by creating JIRA issues at http://jira.stormwindproject.org:8080/browse/NMVP. We'll be more than pleased to evaluate them all and start working on them as soon as possible.

Conclusion

We have not forgotten about NMVP and it will get a new version implemented at some point. We're just not too sure about when will that happen.

Cheers,

#156

2 more releases - Stormwind.NAnt

Releases 0.2.0.0 and 0.2.1.0 of Stormwind.NAnt are out! You can check the releases, and release notes for 0.2.0.0 and 0.2.1.0.

These releases build on the foundation of Stormwind.NAnt to add two nice methods to it: WithNAntExe and WithWorkingDirectory.

Excerpt from using.stormwindproject.org:

WithNAntExeIn

Usage

SvnClient.WithNAntExeIn(string nantPath)

Input
  • string nantPath - This parameter specifies the path that the NAnt exe file is.
Description

Specifies a path for the NAnt executable.

Throws

-

Returns

This method returns a NAntClient object (for chaining).

WithWorkingDirectory

Usage

SvnClient.WithWorkingDirectory(string workingDirectory)

Input
  • string workingDirectory - This parameter specifies the working directory that NAnt should be executed in.
Description

Specifies a working directory for the NAnt executable to run in.

Throws

-

Returns

This method returns a NAntClient object (for chaining).

Hopefully those will be as helpful to you as they are for me.

Cheers,

#155

Heavyweight champion for Stormwind and Stormwind.NAnt

Stormwind gets another sponsor

We just got another heavyweight sponsor, and this time it's literal: Atlassian is our new sponsor. These guys make amazing software, some of which you might know: Jira, Confluence, FishEye and others.

They are not just a great software development company, but they are a company that gives back to the community that supports them. They are sponsoring Stormwind.Project with full enterprise licenses for all their products, without any expiration date. That's a lot more than we could ask for, and for that amazing attitude towards us, open source developers, I thank you Atlassian with all my heart.

In the e-mail they sent me with information on the licenses they awarded us, they were as kind as to say that we didn't have any obligations to boast the usage of their software or to feature their logo in our community portal. Well, guys at Atlassian, be sure that we are proud to be sponsored by you. We are proud to be able to have a confluence logo in our portal, but not because of the sponsorship, but because it's an amazing product, one that I'll endorse wherever I go. The same high-quality standards holds true with all the other products.

A big thanks from the Stormwind Community to Atlassian for your support!!!

Well, without further ado, let's move to our other topic.

Introduction

Following the same lines I did with Stormwind.Svn, I wanted to use NAnt in my current project. Though I do not want to bloat my business domain logic with Process calls to the NAnt.exe file, and parsing the results.

Thus, was born Stormwind.NAnt. It is essentially a fluent interface to allow easy usage of NAnt. It also does some heavy-lifting for you as for parsing the output of NAnt, and dividing it in error and output messages, all of which divided by output message type (Target Execution, Echo Task, Import Tasks, etc.).

This is really good if you intend to do something with the output other than just displaying, like coloring specific messages, or just having some sort of statistics, or anything else you can think of.

Stormwind.NAnt Syntax

Using Stormwind.NAnt is as easy as typing:

var buildResults = NAntClient.WithBuildFile("test.build")
                             .WithProperty("my.custom.property").WithValue("some value")
                             .WithTarget("full.rebuild")
                             .Run()

This is just a first release, and many will follow. If you are interested in using NAnt inside your own code, give us some feedback and we'll definitely try to implement it (when feasible).

Using.Stormwind.NAnt

As we'll do with every single project from this day onwards, we already have the page setup for Stormwind.NAnt in http://using.stormwindproject.org. You can check it out at http://using.stormwindproject.org:8081/display/nant/Home. We hope it's helpful, and we'll definitely improve it as the project moves forward.

If you have anything to add, just let us know and we'll add it to Confluence (with due credit of course). Did I mention Confluence rox?

Conclusion

We have one more sponsor. That only encourages us to keep going and make us confident that we're on the right track.

We also have one more project released. Once more we need feedback from the community. I hope I'll get TONS of e-mails, comments, psychic screams, or whatever medium you'd like to use to talk to us about Stormwind.NAnt. Feel free to post to stormwindcommunitydev@googlegroups.com.

Hope to hear from you guys, even if it is to say: Cool!

Cheers,

#154

Stormwind.Svn

Introduction

Ever wondered how to connect to a Subversion repository using .Net? So do we!

I'm working in a project that needs SVN Connectivity features. "How hard could it be, right?" was my first thought, before spending the next 2 days trying to figure out an easy way of doing that.

All the pain went away when I stumbled on this gem: IronSvn. This very nice project allows us an easy way to connect to SVN using Managed C++ Code. Yes, that's right! That means no interop/PInvoke crap. Kudos to this amazing effort!

Stormwind.Svn

Since you've been reading my posts for a while (yes,  all the three of you, lol), you know that I don't get easily satisfied with frameworks' syntaxes. Then I decided to wrap IronSvn in a fluent interface, thus making it so easy to use that it's kinda boring.

Some examples of the current usage:

SvnClient.ForPath(configuration.CheckoutPath).Status

Now a checkout:

SvnClient.ForPath(configuration.CheckoutPath).Checkout(url);

And an update:

SvnClient.ForPath(configuration.CheckoutPath).Update();

Hope that's easy enough!

Ok, How do I get it?!

I've setup a wiki for it in http://using.stormwindproject.org at http://using.stormwindproject.org:8081/display/svn/Home.

As usual the source code can be found in Stormwind SVN Repository at http://svn.stormwindproject.org/svn/Stormwind.Roswell/SubProjects/Stormwind.SVN.

Any comments, frustrations, desires, etc, can be mustered in the stormwindcommunitydev@googlegroups.com google group.

Conclusion

Check it out if you ever needed to use SVN in your code and felt as frustrated as I did.

Cheers!

#153

Posted by heynemann | 2 Comments

CI All Around

My good friend, Claudio Figueiredo, reminded me that I shouldn't choose a tool that's so important to us without trying a few of them (god damn you for giving me more work, though, lol).

So I decided on trying JetBrains TeamCity, as JetBrains has been a sponsor of Stormwind Project since the very beginning.

Introduction

First of all, I liked the tool very much. It's very easy to configure, it's intuitive and I got my pipeline of builds very quickly.

Hmmm... I see a catch coming...

You are right, my insightful friend. There is a catch. I hit the same wall as in Bamboo (I'll explain more about Bamboo later). After setting the basics up, I decided on getting the extended stuff going, like: NDepend, NCover, Simian, NUnit and stuff like that (even our own custom made plugin). Guess what? No can do!

I could set up NUnit, but I had to use the NUnit Runner that JetBrains built. Don't get me wrong, JetBrains RULE! They build software that I don't imagine to build in the next 10 years. The problem here is that I don't want to use THEIR version of NUnit (currently they have 2.4.6 or something). I want to use my version of it. Yes, we are using 2.5.0 Beta. And it is awesome.

Assumptions

When you are building a tool that's as important as a Continuous Integration Engine you NEED to make sure that it's as extensible as it gets. CCNet is still the tool of choice for me in that area. Within minutes I get a new report up and running, provided that the plug-in generates xml and I have a stylesheet for that XML. Come on, how cool is that?!

The problem here is the assumptions that if people are adopting your amazing CI Engine (and don't get me wrong, they are both AMAZING!!!), they won't need anything else. You and I both know that's not the case.

Build servers are very peculiar beasts. Each company have their own needs and customizations. Even project-level customizations. If you make assumptions on the way people are going to use the tool, then you will have issues with that.

My Dream CI Tool

Instead of just whining I'll just give you a few characteristics of what would be my dream CI tool (and it's probably coming soon anyway):

  1. Easy to use and create new projects
  2. Allow me to have pipelines (builds that are kicked when others succeed)
  3. Allow me to extend it using Xml/Xsl (or a similar way that I can interact with it without having to resort to coding plug-ins)
  4. Allow me to write plug-ins
  5. Allow me to keep artifacts
  6. Allow me to customize my dashboard (So, in an open source projects show the logo and successful builds so the users can download both source and binaries)
  7. Have a consistent notifying mechanism, like CCTray.
  8. Allow comments and taking responsibility for a broken build.
  9. Allows anon access as well as auth access.
  10. Have a set of reports on things like succesful builds, failed builds, time to complete build, builds that it took to fix things, and stuff like that.

I know that's asking for a lot, but the tools out there are almost here. They are very close. My problem is that each of the tools fails in some respect.

Bamboo and some issues

Bamboo has the problem of not supporting NCover, NDepend and company. That is an issue for me, because I like those tools a lot.

They give invaluable insight, and I'm not ready to drop them in the first problem that comes my way.

Right now I've decided on building a plug-in for Bamboo that will allow me to just get an artifact (xml) and apply an XSL to it and render it as a build result or something like that.

How hard can it be, right? (Famous Last Words)

Call for Help

I know that you very smart guys out there can help me out here. I am a newbie in Java, and all plug-ins for Bamboo have to be written in Java. Thus I need someone to help me in creating this thing.

You'll be fully compensated by taking this responsibility. You'll have the amazing compensation of knowing you have helped a lot of people out there that use the product and have similar needs. Also we'll donate one kilo of pasta for Swedish ducks for everyone that applies (no we wont, just kidding lol).

So if you feel like doing some cool coding, just give me a heads up and we can work together to get this working!

Conclusion

Out of all my options, I'm staying with Bamboo right now. It seems to be the most configurable one so far. I hope things will clear up in the next days.

#152

Stormwind.Accuracy, Using Accuracy and a Build Server made of Bamboo

More exciting news today!

Another Release of Accuracy

This one is just a refactoring release (moved some actions to the correct namespace). The new version is 0.1.1.20 and you can get it here: binaries and references.

Using Accuracy

Today I've started writing the contents of the using.stormwindproject.org wiki on how to use Stormwind.Accuracy.

You can check it out at http://using.stormwindproject.org:8081/display/accuracy/Home.

Right now the page on AccuracyStarter is 20%-30% done, and the Test Syntax page is complete (as far as I can tell anyway, we always welcome contributions).

I'd like to get some feedback if possible, since we have just released Stormwind.Accuracy and I know that not having a documentation that can help you in your way through a framework is really hard. We are working on it as fast as possible.

The reason we are releasing often is to gather early feedback, so if you are interested in doing web acceptance testing and think testing it BDD style is a cool idea, give Accuracy a shot and please let us know what you think! Leave a comment here, e-mail me, use smoke signals, anything, but let us know!

A Build Server made of Bamboo

So, since we started using Confluence I've been very fond of Atlassian products. Today I decided to give Bamboo a shot. I don't regret at all!

What a cool build server Bamboo is. It's really easy to configure (it took me a while because we have pretty complex NAnt scripts here at Stormwind.Project), the UI is very intuitive and it's very extensible.

You can check it out at http://bamboo.stormwindproject.org. It's our new build server and we are just waiting for it to become stable and have all our projects to change bamboo to http://buildserver.stormwindproject.org.

I just love the way it works with reports, builds and artifacts. I'll blog about those later. One thing I really want to try is the Confluence integration. That would be amazing, to have build information in the project page in http://using.stormwindproject.org.

So far I'm liking very much Atlassian products. We'll see how the usage makes me think about them.

#151

Accuracy and using.stormwindproject.org

Well I have some good news today!

Accuracy 0.1.0.18

First, Accuracy has reached a point where we can release it. Version 0.1.0.18 (binaries and references) is just out of the oven. Get it while it's hot!

This version includes several syntax improvements, all of which I plan on publishing in the Accuracy wiki in using.stormwindproject.org.

Version 0.1.0.18 is not yet production ready, not because it's not stable, but because we haven't captured the minimum amount of automations that I think are needed in day-to-day web development. We'll probably have those in the next iterations.

Just a quick roadmap on the next iterations:

Iteration 2

  1. Add IsDisabled and IsEnabled to all controls (Right now most of them feature this)
  2. Add ListBox actions, so you get to automate list boxes
  3. Allow Element Naming Strategy configuration in the app.config file
  4. Support Excel Fixtures - This would be a nice way of setting up your test data. Still not sure if this will make iteration 2 or bleed to iteration 3.

Iteration 3

  1. Add Selenium Browser Driver - Don't want to use Watin? No problem. It's extremely easy creating a new Browser Driver for Accuracy.

Iteration 4

  1. HttpUnit Browser Driver - Did I mention it is very easy to create a new browser driver?

Using.StormwindProject.org

We have finally set up a wiki for useful information on Stormwind Projects at http://using.stormwindproject.org. It's a little empty right now, but I'm trying my best to fill it as fast as possible.

I've set the Stormwind.Accuracy page there already, so that's where I'll be including all the information on syntax, creating browser drivers, creating element naming strategies, and (I HOPE) all real usage scenarios.

We are in the process of switching our build server, to use Bamboo or some other tool (I'd like to use Bamboo because it's integrated with confluence). More news on that later.

For now, check out using.stormwindproject.org, and if you feel like contributing, just e-mail me at heynemann at gmail dot com.

#150

Not sure which CI Server to use?

We've been using CruiseControl.Net for our builds in Stormwind Project.

Even though I like CCNet a lot, it's coming to the point where we need more from our CI Server. We were going to build this ourselves as plug-ins for CCNet.

That's a lot of work though, so I started to think about trying other build servers. I, then, stumbled on this gem: CI Feature Matrix.

It's a MASSIVE comparison of Build Servers all around by ThoughtWorks and CodeHaus. If you're not sure which one to pick, or just would like to have more options, by all means, check it out.

#149

Posted by heynemann | 6 Comments

Looking for a VPS Hosting?

KickAssVPS is an active sponsor of Stormwind Project. Without their support much of what we do would be impossible.

My post is not about their attitude towards us, which is by itself amazing, since they are granting us expensive resources (A VPS with a Dual Core CPU and 2gigs of Ram, with unlimited traffic) for free.

My post is about the incredible service they provide, even without us paying a dime. Yesterday we had a problem in our build server that really got to us. Whenever we opened IE we would get several windows, or even worse, when you typed an url in IE you would get a FireFox window (that is kinda cool, though! lol!). Usually I wouldn't care, but since Accuracy's Watin Browser Driver uses IE to drive pages, we need to care if IE doesn't work in the Build Server.

After scratching my head for quite a while I decided on asking KickAssVps for help. They weren't only supportive... They solved it in hours! The description of the problem is here: http://blog.codefront.net/2006/03/19/how-to-fix-ie-always-opening-firefox-instead/.

Their attitude of partnership is what really impressed me. It didn't feel like talking to a helpdesk. It felt like talking to a friend who's trying to help me solve a problem. They kept me up-to-date all the way until the problem was solved.

After a GREAT service, all I can say about you guys is: THANK YOU!

#148

Posted by heynemann | 1 Comments
Filed under