Giving in to the dark side

 

No, it’s not as bad as it sounds.  I’ve decided to stop cross posting here and make my main tech blog the one at LosTechies.  I’m doing this for a number of reasons, including the hassle of cross posting, google ranking-fu and others.  And, to be honest, I’d like to move away from being tied to the “DotNet” “brand” since my interests over the past couple years have moved beyond the .NET platform.

I’ll probably still keep this content up for a little while at least, but for the 2 people that might actually be following this blog still, I’ve updated my FeedBurner feed to point to the RSS feed on my LosTechies blog.  And while you’re here, you might as well just subscribe to the main LosTechies RSS feed.  All of those guys (excluding myself of course) are some crazy smart folks!

I may have some other plans for beninghove.com at some point as a central hub for all of my stuff, but right now it just hosts my wife’s blog.  :)

Smart Constructor Anti-Pattern

 

If you look at the definition of a constructor in the context of software development on Wikipedia (a completely factual and reliable source :), you'll find this simple statement of their responsibility...

"Their responsibility is to initialize the object's data members and to establish the invariant of the class, failing if the invariant isn't valid."

Simple really.  Just initialize the (usually) private data members and ensure the arguments won't put the object in an invalid state.  But so often I see constructors doing so much more than that.  One example I've seen of this recently is in presenters.

The (perhaps contrived) scenario:
When a view loads for the first time, you need to load some lookup data that gets populated in a combo box on the view and set the number of logged in users on the view.

Here is our IView interface for reference:

   1: public interface IView
   2: {
   3:     void BindWith(IEnumerable<User> users);
   4:     bool HasUserSelected { get; }
   5:     void SetNumberOfLoggedInUsersTo(int numberOfUsers);
   6: }

“Smart” Constructor Approach

One might be tempted to start writing a spec like the one below.

   1: public class SmartConstructorPresenterSpecs
   2: {
   3:     public class when_the_presenter_is_constructed : ContextSpecification
   4:     {
   5:         private IView View;
   6:         private IUserRepository UserRepository;
   7:         private IAuthenticationService AuthenticationService;
   8:         private SmartConstructorPresenter SUT;
   9:         private IEnumerable<User> Users;
  10:  
  11:         protected override void When()
  12:         {
  13:             Users = new List<User> {new User(true), new User(true), new User(false)};
  14:  
  15:             View = Mock<IView>();
  16:             UserRepository = Mock<IUserRepository>();
  17:             AuthenticationService = Mock<IAuthenticationService>();
  18:  
  19:             UserRepository.Stub(x => x.All()).Return(Users);
  20:  
  21:             SUT = new SmartConstructorPresenter(View, UserRepository, AuthenticationService);
  22:         }
  23:  
  24:         [Test]
  25:         public void it_should_populate_the_view_with_a_list_of_users()
  26:         {
  27:             View.AssertWasCalled(x => x.BindWith(Users));
  28:         }
  29:  
  30:         [Test]
  31:         public void it_should_set_the_number_of_logged_in_users_on_the_view()
  32:         {
  33:             View.AssertWasCalled(x => x.SetNumberOfLoggedInUsersTo(2));
  34:         }
  35:     }
  36:  
  37:     public class when_attempting_to_login_and_a_user_is_not_selected : ContextSpecification
  38:     {
  39:         private IView View;
  40:         private IUserRepository UserRepository;
  41:         private IAuthenticationService AuthenticationService;
  42:         private SmartConstructorPresenter SUT;
  43:         private IEnumerable<User> Users;
  44:  
  45:         protected override void EstablishContext()
  46:         {
  47:             Users = new List<User> {new User(true), new User(true), new User(false)};
  48:  
  49:             View = Mock<IView>();
  50:             UserRepository = Mock<IUserRepository>();
  51:             AuthenticationService = Mock<IAuthenticationService>();
  52:  
  53:             UserRepository.Stub(x => x.All()).Return(Users);
  54:             View.Stub(x => x.HasUserSelected).Return(false);
  55:  
  56:             SUT = new SmartConstructorPresenter(View, UserRepository, AuthenticationService);
  57:         }
  58:  
  59:         protected override void When()
  60:         {
  61:             SUT.Login();
  62:         }
  63:  
  64:         [Test]
  65:         public void it_should_NOT_perform_a_login()
  66:         {
  67:             AuthenticationService.AssertWasNotCalled(x => x.Login());
  68:         }
  69:     }
  70: }

And implement the presenter.

   1: public class SmartConstructorPresenter
   2: {
   3:     private readonly IView view;
   4:     private readonly IAuthenticationService authenticationService;
   5:  
   6:     public SmartConstructorPresenter(IView view, IUserRepository userRepository,
   7:                                      IAuthenticationService authenticationService)
   8:     {
   9:         this.view = view;
  10:         this.authenticationService = authenticationService;
  11:  
  12:         var users = userRepository.All();
  13:  
  14:         this.view.BindWith(users);
  15:         this.view.SetNumberOfLoggedInUsersTo(users.Where(x => x.IsLoggedIn).Count());
  16:     }
  17:  
  18:     public void Login()
  19:     {
  20:         if (view.HasUserSelected)
  21:             authenticationService.Login();
  22:     }
  23: }

And then the view.

   1: public class View : IView
   2: {
   3:     private event VoidHandler loginButtonClick = delegate { };
   4:     private readonly SmartConstructorPresenter presenter;
   5:  
   6:     public View()
   7:     {
   8:         presenter = new SmartConstructorPresenter(this, null, null);
   9:  
  10:         // simulate a possible login button click
  11:         loginButtonClick += () => presenter.Login();
  12:     }
  13:  
  14:     public void BindWith(IEnumerable<User> users)
  15:     {
  16:         // bind this stuff to something
  17:     }
  18:  
  19:     public bool HasUserSelected
  20:     {
  21:         get { return false; }
  22:     }
  23:  
  24:     public void SetNumberOfLoggedInUsersTo(int numberOfUsers)
  25:     {
  26:         // set some label or something
  27:     }
  28: }
  29:  
  30: public delegate void VoidHandler();

If you take a look at the code above, you can see that a the view is being populated with a list of users when the presenter is constructed.  While this might seem harmless at first, take a look at the second specification : when_attempting_to_login_and_a_user_is_not_selected.it_should_NOT_perform_a_login.

Notice that the only thing we care about is verifying that when a user is not selected, that we’re NOT attempting to call login on the authentication service.  But since our constructor has some “smarts”, we’re required to stub out the call to the user repository just to keep the test from breaking.  This may not look like a big deal in a simple case like this.  But as your codebase grows, it can make your specs brittle and harder to understand.

“Dumb” Constructor Approach

Another way this could be done is by delegating the initial operations on the view to an explicit “initialize” method.  Let’s see what that might look like.

First the specs of course.  :)

   1: public class DumbConstructorPresenterSpecs
   2: {
   3:     public class when_initializing : ContextSpecification
   4:     {
   5:         private IView View;
   6:         private IUserRepository UserRepository;
   7:         private IAuthenticationService AuthenticationService;
   8:         private DumbConstructorPresenter SUT;
   9:         private IEnumerable<User> Users;
  10:  
  11:         protected override void EstablishContext()
  12:         {
  13:             View = Mock<IView>();
  14:             UserRepository = Mock<IUserRepository>();
  15:             AuthenticationService = Mock<IAuthenticationService>();
  16:  
  17:             SUT = new DumbConstructorPresenter(View, UserRepository, AuthenticationService);
  18:         }
  19:  
  20:         protected override void When()
  21:         {
  22:             Users = new List<User> {new User(true), new User(true), new User(false)};
  23:  
  24:             UserRepository.Stub(x => x.All()).Return(Users);
  25:  
  26:             SUT.Initialize();
  27:         }
  28:  
  29:         [Test]
  30:         public void it_should_populate_the_view_with_a_list_of_users()
  31:         {
  32:             View.AssertWasCalled(x => x.BindWith(Users));
  33:         }
  34:  
  35:         [Test]
  36:         public void it_should_set_the_number_of_logged_in_users_on_the_view()
  37:         {
  38:             View.AssertWasCalled(x => x.SetNumberOfLoggedInUsersTo(2));
  39:         }
  40:     }
  41:  
  42:     public class when_attempting_to_login_and_a_user_is_not_selected : ContextSpecification
  43:     {
  44:         private IView View;
  45:         private IUserRepository UserRepository;
  46:         private IAuthenticationService AuthenticationService;
  47:         private DumbConstructorPresenter SUT;
  48:  
  49:         protected override void EstablishContext()
  50:         {
  51:             View = Mock<IView>();
  52:             UserRepository = Mock<IUserRepository>();
  53:             AuthenticationService = Mock<IAuthenticationService>();
  54:  
  55:             SUT = new DumbConstructorPresenter(View, UserRepository, AuthenticationService);
  56:         }
  57:  
  58:         protected override void When()
  59:         {
  60:             View.Stub(x => x.HasUserSelected).Return(false);
  61:  
  62:             SUT.Login();
  63:         }
  64:  
  65:         [Test]
  66:         public void it_should_NOT_perform_a_login()
  67:         {
  68:             AuthenticationService.AssertWasNotCalled(x => x.Login());
  69:         }
  70:     }
  71: }

Then the implementation of the presenter.

   1: public class DumbConstructorPresenter
   2: {
   3:     private readonly IView view;
   4:     private readonly IUserRepository userRepository;
   5:     private readonly IAuthenticationService authenticationService;
   6:  
   7:     public DumbConstructorPresenter(IView view, IUserRepository userRepository,
   8:                                     IAuthenticationService authenticationService)
   9:     {
  10:         this.view = view;
  11:         this.userRepository = userRepository;
  12:         this.authenticationService = authenticationService;
  13:     }
  14:  
  15:     public void Initialize()
  16:     {
  17:         var users = userRepository.All();
  18:  
  19:         view.BindWith(users);
  20:         view.SetNumberOfLoggedInUsersTo(users.Where(x => x.IsLoggedIn).Count());
  21:     }
  22:  
  23:     public void Login()
  24:     {
  25:         if (view.HasUserSelected)
  26:             authenticationService.Login();
  27:     }
  28: }

And a slight change to the view implementation.

   1: public class View : IView
   2: {
   3:     private event VoidHandler loginButtonClick = delegate { };
   4:     private event VoidHandler load = delegate { };
   5:     private readonly DumbConstructorPresenter presenter;
   6:  
   7:     public View()
   8:     {
   9:         presenter = new DumbConstructorPresenter(this, null, null);
  10:  
  11:         // simulate a couple possible events
  12:         load += () => presenter.Initialize();
  13:         loginButtonClick += () => presenter.Login();
  14:     }
  15:  
  16:     public void BindWith(IEnumerable<User> users)
  17:     {
  18:         // bind this stuff to something
  19:     }
  20:  
  21:     public bool HasUserSelected
  22:     {
  23:         get { return false; }
  24:     }
  25:  
  26:     public void SetNumberOfLoggedInUsersTo(int numberOfUsers)
  27:     {
  28:         // set some label or something
  29:     }
  30: }
  31:  
  32: public delegate void VoidHandler();

I would prefer this approach since I think it keeps the specs and the presenter implementation itself quite a bit cleaner.  Notice now in the spec: when_attempting_to_login_and_a_user_is_not_selected.it_should_NOT_perform_a_login.

It cares nothing about retrieving users from the repository.  All it cares about is exactly what the context/spec sentence states.  And if you notice, there is even an opportunity to DRY up these specs, if you prefer, by breaking out a base context class, since they both have identical EstablishContext() methods.  This is something that wouldn’t be quite as easy or clean to do in the SmartConstructorPresenterSpecs in the previous section.

Quick Tip : Load/Initialize Convention

You might be thinking that you don’t want to have to remember to create or call an Initialize() method all the time.  Well recently, a co-worker of mine pointed out a simple way we could leverage some auto-wiring magic + a base presenter class to make it more of a convention that you can use when needed and to negate the need to manually call Initialize() all the time.  So here is one approach to make that easier.

NOTE: The presenter specs don’t need to change at all for this refactoring.

First we add a Load event handler to our IView interface:

   1: public interface IView
   2: {
   3:     void BindWith(IEnumerable<User> users);
   4:     bool HasUserSelected { get; }
   5:     void SetNumberOfLoggedInUsersTo(int numberOfUsers);
   6:     event EventHandler Load;
   7: }

Then we introduce a base presenter class (which I’m simply calling Presenter ‘cause I think Base* class naming is the new hungarian notation…. :).

   1: public class Presenter<T> where T : IView
   2: {
   3:     public Presenter(T view)
   4:     {
   5:         view.Load += delegate { Initialize(); };
   6:     }
   7:  
   8:     public virtual void Initialize()
   9:     {
  10:     }
  11: }

Then our DumbConstructorPresenter just changes slightly to inherit and override the Initialize() method.

   1: public class DumbConstructorPresenter : Presenter<IView>
   2: {
   3:     private readonly IView view;
   4:     private readonly IUserRepository userRepository;
   5:     private readonly IAuthenticationService authenticationService;
   6:  
   7:     public DumbConstructorPresenter(IView view, IUserRepository userRepository,
   8:                                     IAuthenticationService authenticationService) : base(view)
   9:     {
  10:         this.view = view;
  11:         this.userRepository = userRepository;
  12:         this.authenticationService = authenticationService;
  13:     }
  14:  
  15:     public override void Initialize()
  16:     {
  17:         var users = userRepository.All();
  18:  
  19:         view.BindWith(users);
  20:         view.SetNumberOfLoggedInUsersTo(users.Where(x => x.IsLoggedIn).Count());
  21:     }
  22:  
  23:     public void Login()
  24:     {
  25:         if (view.HasUserSelected)
  26:             authenticationService.Login();
  27:     }
  28: }
And finally our view implementation.

   1: public class View : IView
   2: {
   3:     // in the context of a winforms app, 
   4:     // this event would be automatically declared and fired
   5:     public event EventHandler Load = delegate { };
   6:  
   7:     public event VoidHandler LoginButtonClick = delegate { };
   8:     private readonly DumbConstructorPresenter presenter;
   9:  
  10:     public View()
  11:     {
  12:         presenter = new DumbConstructorPresenter(this, null, null);
  13:  
  14:         // simulate a possible login button click
  15:         LoginButtonClick += () => presenter.Login();
  16:     }
  17:  
  18:     public void BindWith(IEnumerable<User> users)
  19:     {
  20:         // bind this stuff to something
  21:     }
  22:  
  23:     public bool HasUserSelected
  24:     {
  25:         get { return false; }
  26:     }
  27:  
  28:     public void SetNumberOfLoggedInUsersTo(int numberOfUsers)
  29:     {
  30:         // set some label or something
  31:     }
  32: }

Notice in the Presenter<T> class above, we’re simply wiring up the Load event from the IView to automatically call the Initialize() method for us.  Concrete presenters could then simply just override the Initialize() method if necessary.

Then notice in the updated view implementation, we don’t have explicitly call the Initialize() method anymore in our views, since that’s done for us automatically in the Presenter<T> class.

As I’m writing this I realize that the act of overriding this Initialize() method would have to be remembered as well.  But I think what you gain from a convention standpoint and the fact that you don’t have to explicitly call it from the views is enough of a win to warrant this technique.  But as always, I’ll probably change my mind tomorrow when I figure out a better way to do all of this.  :-)

So, putting aside the possibly poor examples and the cloud of MVP in all of this, my goal was just to simply give an example of why it can be a good idea to keep your constructors simple and lean across the board, in many different types of classes.

Of course feedback is always welcome.

NHibernate + XML Columns

 

One of the things I’ve been working on recently involves using XML columns in SQL Server.  Starting out, it was simple and I was just doing vanilla ADO.NET (wrapped in a simple Query API) combined with XML serialization/deserialization, which worked pretty well for a while. 

But as the complexity has grown, it seemed like too much time was being spent enhancing the persistence infrastructure in this particular area of the application.  In comes NHibernate, which is already integrated and available to me on this particular project.  In fact, the only reason I didn’t use NHibernate for this particular feature from day one is because I didn’t see a lot of information available regarding NHibernate and XML columns.  I did find one old blog post by Ayende and a seemingly outdated article on the NHibernate site.  But I admit I’ve never jumped into creating custom user types in NHibernate and wasn’t yet comfortable moving forward with that approach.  Since what I needed at the time was pretty simple, I went forward without NHibernate for the time being.

Without going into too much detail, I came to a point where I wanted to spike with NHibernate to see how it handles columns with an XML data type.  I’ve only tried one of a couple approaches so far, but wanted to get some feedback on it so far.

First, a couple goals:

  • Store a set of data as XML in a SQL Server XML column
  • Ability to deserialize the XML into strongly typed objects for use in the rest of the code base

Warning: contrived example ahead.  The real implementation is basically for lightweight messages.

   1: public class Person
   2: {
   3:     private readonly string contactInformationXml;
   4:  
   5:     public Person(ContactInformation contactInformation)
   6:     {
   7:         // NOTE: SerializeToXmlStream extension method not shown
   8:         contactInformationXml =
   9:             new StreamReader(contactInformation.SerializeToXmlStream()).ReadToEnd();
  10:     }
  11:  
  12:     public ContactInformation GetContactInformation()
  13:     {
  14:         var xmlDocument = new XmlDocument();
  15:         xmlDocument.Load(contactInformationXml);
  16:  
  17:         // NOTE: DeserializeInto extension method not shown
  18:         return xmlDocument.DeserializeInto<ContactInformation>();
  19:     }
  20: }

And an excerpt from an example NHibernate mapping for this:

   1: <property name="ContactInformationXml" column="ContactInformation" 
   2:           type="String" not-null="true" access="field.camelcase" />

So in the Person class above, the constructor accepts a strongly typed component for the contact information, serializes it to XML and stores it in a private field as a string.  Then the NHibernate mapping takes care of persisting the serialized string to the XML column named ContactInformation in the database.  To see how it would get used when NHibernate loads a Person, the GetContactInformation() method is an example of deserializing the string into the strongly typed ContactInformation object which it then returns.

Now, putting aside the reasons for or against using XML in this way, using XML columns in general or the fact that serialization concerns shouldn’t be placed inside a class like this…

I’m looking for feedback on this approach and if anyone else has any better ways of doing this.  I’ve yet to go down the path of creating a custom NHibernate user type, even though I think doing it that way would be a bit cleaner and flexible in the future.

Anyone have any other good examples of using NHibernate for persisting data to XML columns?

Looking for some awesome .NET developers (work from home)

 

Are you:

  • an experienced and passionate .NET developer
  • looking to join a profitable and growing company who creates software solutions for a niche industry that is booming despite the current economy
  • wanting to work from home

Excerpts from our job posting:

Company:
TrackAbout, Inc.
www.trackabout.com

TrackAbout is a small, profitable and growing software company that provides Software as a Service (SaaS) asset tracking services through the combination of a hosted web platform and various mobile devices that run our custom software. We have a solid, international customer base, are experiencing high demand for our services and are looking at exciting times ahead. We are looking for an exceptional and experienced developer who is interested in playing a pivotal role in the growth of a small company. If you’re truly passionate about technology, we want to talk to you.

Location:
TrackAbout's main office is just outside of Pittsburgh, PA.  However, our development staff is completely virtual (no office) and each developer works from home.

Position Details:
We're seeking a full-time developer (no contractors please) with a minimum of 5 years of experience in web development, object-oriented programming and relational database programming. Agile experience is a plus.  You'll be working on all aspects of the TrackAbout offering including our ASP.NET website and web services, MS SQL Server 2005 and various wireless mobile devices.

Your responsibilities will include architecting, designing and building new features, enhancing existing features, and fixing bugs. On occasion, you may be asked to provide second-tier technical customer support for requests that require deeper technical skills than our first-tier support engineers can handle.

All members of our development team are dedicated to keeping up with the latest techniques, technologies and tools related to software development. We take time out to share our knowledge with one another and improve both our skills and our distributed development environment. We often experiment with and integrate new tools into our environment. We use ReSharper, CruiseControl.NET, TDD with NUnit, FXCop, NCover, Bugzilla, and Drupal to supplement our development efforts.

So if you're interested and want to come help me sling some code, check out the full job posting and reply there.

MVC - Free Yourself from Web Forms!

 

Thanks to all who came out last night to hear my talk on MVC at the Richmond .NET User Group.  It was a blast.  I wish we had more time to dig into some more code, but maybe next time.  90 minutes flies by!

As promised, here are the slides from the presentation.

How did I get started in software development?

 

Well apparently Derik is trying to bring me out of my blogging hiatus by tagging me with the meme of the week.  :)  My story is pretty boring, but I'll play along in an effort to bring me out of my recent break from the blogosphere.

How old were you when you started programming?

I suppose I was 14 (9th grade) when I first started dabbling on an Apple IIe with all the joys of line numbers and "gotos".  I enjoyed it but I definitely wasn't as smart as the kid who created a program to generate one of those "magic eye" pictures that were all the rage at the time.  Besides, I was a band geek super cool drummer for most of my high school days.

What was your first language?

I guess technically Apple Basic and QBasic were my first languages where I would mess with my Mom by writing stupid little QBasic programs to simulate her computer exploding.  Ahh, those were the days.  But I would probably say that my Pascal class in 11th grade was where I really started to learn how to create stuff and solve problems by typing "codes" into some crazy thing called a "computer".

What was the first real program you wrote?

Probably the first "real" program I ever wrote was a Pick 3 lottery program in my Pascal class followed later by a standard 5 card draw poker game, with stunning graphics!  :)  Looking back, I'm not sure if those were assigned projects or if I came up with those on my own, but regardless, either the school was encouraging the students to write gambling software or I had some weird attraction to writing software that could possibly ruin people's lives.  Both equally disturbing... LOL.

If you knew then what you know now, would you have started programming?

Oh yeah.  I actually started my "professional" career on the hardware/networking side of things but ultimately I always knew I was a codemonkey at heart and eventually moved in that direction professionally.  Besides, the money is a heck of a lot better too.  :)

If there is one thing you learned along the way that you would tell new developers, what would it be?

So, what's my size limit for this answer?  :D

Well of course I'd say to have fun and be passionate and all that jazz.  To me, that's just a given.  But also to focus on the fundamentals.  Learn *why* it's important to make testability and maintainability a first-level concern when building software.  Get started in the community early because you'll make some great friends and learn a ton along the way.  I could say a ton more, but I don't think the internet could hold them all.

What's the most fun you've ever had ... programming?

Not sure I can pinpoint a single time, but the times I've been able to do some greenfield projects and make testability a first-class citizen in the design, I've been very happy with the results.  Also the journey towards "beautiful code" is something that I enjoy very much.  Getting creative and coming up with new and useful ways of wiring something together or even just naming a method well is enough to make me happy. 

Recently, I'd say that my brief stint in the Rails world (not professionally) was the most fun I've had coding in quite a while.  Perhaps that's why I'm getting the Ruby itch again.

The poor saps that I'm tagging?

Change I can achieve in

 

Well, this post is more of the personal variety, but it may affect future posts in one way or another (however, not like this).  In short, a season of change is upon me.

Big change #1.  I'm getting out of the consulting world for a while.  It's been grand and I've learned a ton about people, business and technology.  But I felt it was time for something different.  Because of the types of consulting firms I've worked with the past 3 years, the one thing I haven't liked is that I never got to work on a team long enough to really get to know the folks I was working with very well.  Seems like just when my team and I were really getting productive together, we'd all get thrown to different projects, usually with folks we hadn't worked with before.  Obviously some of this has to do with the nature of consulting in general, but I'm sure some firms see the value in keeping teams together as much as possible than others.

Big change #2.  Like Chad, I also started a new job this week, for a great product company.  The company is small, which I really like, especially when talking about small development teams.  I'm hoping to learn a lot (drinking from the firehose this week) and be a good contributor along side the other couple developers on the team.  It's an interesting product with some pretty unique challenges to tackle, from what I've seen so far.  I'll be doing mostly ASP.NET work, with maybe a little mobile device stuff thrown in for good measure.

Big change #3.  I'm joining the world of web workers!  Yep, I'm now working from home exclusively.  This might be the biggest change for me in all of this, but I'm very much looking forward to adapting to this type of lifestyle/work environment.  I'm sure I'll have some things to learn, specifically about how to keep things balanced, but so far it's been enjoyable.  Not to mention, it'll help me kick the "eating out" habit that I was stuck in during my traditional office jobs.  :O

So far I'm finding that my reliance on tools like IM, Skype and SharedView (which is pretty decent) just grew exponentially.  I'm looking forward to possibly trying out some remote pairing as soon as I get settled.

To make this post at least somewhat productive, here are a couple tools and a bonus tip that I've been introduced to over the past couple days that you may find useful.

Bonus Tip: I've been a huge Pidgin fan ever since it had that weird Gaim name.  I use it for everything.  AIM, Yahoo, GTalk, IRC, Twitter.  One tip that I learned today is how to set up Pidgin to "auto join" you to a particular IRC channel as soon as you login into Pidgin.  Here's how to do it...

  1. Click Buddies > Add Chat
  2. Choose your IRC account/server from the Account drop-down
  3. Type the name of the channel you want to join
  4. Give the chat an alias (I just used the channel name)
  5. Click Add
  6. Now find that new chat in your list of buddies, Right-Click > Auto-join
  7. That's it!

So now when you fire up Pidgin, it'll automatically join you to that room.  Most of you may already know about this, but I thought it was pretty cool.

Anyway, until next time.  I have a lot of things to blog about in the hopper.  Hopefully I can get around to them sometime soon.  *sigh*

Scribbish Skin - For Subtext

 

This is long overdue, but Nick Parker asked me a long time ago (sorry Nick) where I got the skin I use for my blog and I told him I'd make it available.  I actually ported it myself from the existing Scribbish theme that was already available for Mephisto, Wordpress and others.  I really liked the simplicity of it so I just grabbed the CSS and hacked away at it myself until I got it looking close enough as a Subtext skin.

I submitted it to the Subtext skins showcase, but it may take a bit for it to get approved.  So for now, you can just download it from here.

I kind of put this together in a hurry, so please let me know if you find any problems with it.

Enjoy!  :)

ActiveSupport.NET - Namespace Overhaul

 

Figured I'd try and get this nailed down as early as possible.  So after some recent feedback, I decided to change the namespacing so that it focused more on "behavior/concern" rather than "types".  What this means is...

Instead of:

  • using ActiveSupport.Core.Extensions.String;  // containing string extensions for access, conversions, etc.
  • using ActiveSupport.Core.Extensions.Integer;  // containing integer extensions for access, inflections, etc.
  • ...

It's now just this:

  • using ActiveSupport;  // just basic extensions
  • using ActiveSupport.Access // all accessor-based extensions for ALL types
  • using ActiveSupport.Conversions // all conversion-based extensions for ALL types
  • ...

I'm pretty much thinking the accessor based stuff will probably get used the most.  But either way, by grouping this way, I'm hoping they'll be a bit easier use.  And of course when our R# 4.0 EAP shows up next (right Ilya? :) all of this namespace'ry will must magically work for us.  :)

What do you think?  Is this a better approach to keeping things clean and organized?

ActiveSupport.NET - Update

 

So it seems there is some interest in getting something like this up and running.  I went ahead and did some of the basic "project setup" type tasks.  Here are some links of interest...

I look forward to some more discussions about the best way to structure things to make it easy to use.  On the google code project site you'll find a brief description of the project as well as a wiki page I've started to give some basic info on how the code base is structured (tools, build targets, etc...).  I'm sure all of this will change/evolve as things progress.

And thanks Joe (for already submitting the first patch) and others that have said they want to get involved.  Should be fun...  :)