Geeks With Blogs
Mike Nichols - SonOfNun Technology If I were the captain on a big steamboat... August 2006 Entries
Colibri tool
I've been using the Colibri tool to open my apps and control panels for some time. A little summary of the tool is here with screenshots. Really, it's so simple there isn't much to say other than why you may want to consider it if you use Google Desktop instead of the silly QUickLaunch icons next to the "Start" menu. With a quick Ctl+Space (or whatever you want it to be) and just three keys I open whatever application I want. Same thing if I want to change my display setting (Ctl+Space+Dis) and so ......

Posted On Thursday, August 31, 2006 4:03 AM

NHibernate Composite User Type (ICompositeUserType) gets even better
In a previous post I proposed a Generic class for building custom types using NHibernate. This lets us keep our Domain entities free from requiring hidden fields or other methods to persist Value Objects. While a Component may be used, this little Generic class lets us keep the power of HQL for our complex types. One situation that is not addressed in the Hibernate in Action book, though, is what to do when you want to combine these Value Objects into one Value Object. For example, if we have a Money ......

Posted On Wednesday, August 30, 2006 12:25 PM

NHibernate exception for collections without an access strategy

According to this outstanding bug here, failing to put an access strategy on a collection that doesn't have a setter result in an exception that is enigmatic at best. Thankfully, I found this and found a mapping that didn't have a default access strategy on it...that fixed it.

Posted On Wednesday, August 30, 2006 12:10 PM

NHibernate Mapping
One of the difficult things about NHibernate is just getting started. While it is true that there is lots of docs and writings about her older brother Hibernate, the fact is that the documentation for NHibernate is really bad. It is true that it is just a port of Hibernate, so you can get thru it just studying the Hibernate docs. The big one to have is Hibernate in Action. On occasion, I would get errors when trying to persist a collection that perhaps bidirectionality (is that a word?) that would ......

Posted On Wednesday, August 30, 2006 5:29 AM

JavaScript debugging in Visual Studio
According to this post, javascript can now be debugged in Visual Studio ... sounds cool. This is a HUGE need!

Posted On Friday, August 25, 2006 8:35 PM

Microsoft To Change Name
Microsoft announced today they are changing their name to Macrosoft To celebrate, they have also implemented a new licensing constraint on applications built with their popular .NET framework. The new licensing requires that they have rights to both name your application and issue version numbers. To accomodate this they are implementing a new algorithm for revision numbers using PI in lieu of the boring increment-by-1 method. Minor version changes will now use the Hebrew alphabet instead of plain ......

Posted On Friday, August 25, 2006 12:31 PM

The Aggregate Liberation
For a while, I really sought to navigate my domain via bidirectional relationships among entities. Technically, there's nothing wrong with this, but my failure to design according to the Aggregate boundaries that Eric Evans talks about in his book Domain Driven Design led to unnecessary complication in maintaining the relationships AND an anemic domain. For example, if I consider an Employee in context of being an invariant of Enterprise and require all logic dealing with Employees to be navigated ......

Posted On Thursday, August 24, 2006 1:03 PM

When I see this more than once...
Let's say I have a class Person with your typical field/properties FirstName, LastName, blah, blah... Then let's say I decide to implement the Null Object Pattern. Why I decide this isn't important right now, but I know that I am just going to initialize all my fields to default setttings (string.Empty for FirstName,LastName, etc..) in the constructor. Like so: public class NullPerson : Person, INull { public NullPerson() : base(string.Empty,string.Em... { } } Now, notice I have ......

Posted On Thursday, August 24, 2006 7:17 AM

The Subclass Me Reflex
One of the side-effects of being new out to learning Object Oriented Principles is the propensity to see everything as a subclass of something else. As if all objects shoudl derive from IThing since surely they might ALL have to have some common behaviour, right?!? This is motivated by a GOOD desire...wanting to eliminate duplication of code. So the novice reaches into his toolbox and gets *the* hammer and subclasses, hoping that all inheritors need something like the method he is building. There ......

Posted On Wednesday, August 23, 2006 12:59 PM

Remember Who The Enemy Is
I have been reading several posts from folks I respect for their advancement of practices like TDD, Agile ,DDD, and so on. Their wisdom has helped give me a great toolset to build deep, maintainable code that is production-minded throughout now. This is contrasted to writing what amounted to 'demoware' as I tried to write maintainable code using RAD tools. Still, I think Agile-minded leaders need to bear in mind that the enemy is not Microsoft if their creed is in fact rooted in the pragmatism of ......

Posted On Wednesday, August 23, 2006 4:04 AM

NHibernate Alpha release supports .NET 2.0 features like generics and nullables
A new NHIbernate release (alpha) supports generics and nullable types. The previews have been good. Even though i love NHibernate, this email by the development lead of the project underscored the need to avoid having Persistence mechanism details invading Domain logic ......

Posted On Monday, August 21, 2006 3:36 AM

A Data Transfer Object is a Parameter Object for my Factory?
Continuing with tightening my app using Domain Driven Design principles, I am trying to instantiate a NEW Person object. SETUP:This Person object has Email objects (whether Value or Entity is irrelevant). Now, the Person is my Aggregate so a PersonFactory class exists. Person has a method 'AddEmail(string text, string label, bool isPrimary)' . PROBLEM: I have a Service Layer (application layer) that is operating on my use case 'Add Person' and my view has created a PersonDTO that has a collection ......

Posted On Friday, August 18, 2006 5:31 AM

Dependency Injection ala Structure Map
Since I want to use words like "Repository" and "DDD" (ok, that's an acronym not a word) I have been slamming my head against Eric Evans' and Jimmy Nilssons' Domain Driven Design books in tandem. I get the same feeling when reading Evans' book that I used to get when I was playing jazz gigs in town (drummer) and some horn player would show up that was a blast to play with....only to find out later that he was in Maynard Ferguson' band for years. I knew there was something there, I just didn't get ......

Posted On Tuesday, August 15, 2006 1:00 PM

Accessing Domain Driven Design via .NET layers and meditations on fuzz
Just starting out digging deep into Domain Driven Design (DDD) and reading thru Jimmy Nilsson's book Applying Domain-Driven Design and Patterns has the same side effects on me that happen whenever I learn something new about software...fuzz. It's good fuzz but I am confuzzed about what seem to be contradictory ideas by the gurus Fowler/Evans on this topic. First, we are told NOT to remote. Fine. Then in Fowler's PoEAA book we are told (by Randy Stafford) to consider very before implementing dumb ......

Posted On Tuesday, August 15, 2006 4:13 AM

NHibernate Custom Type Mapping : ICompositeUserType versus IUserType
When trying to map a custom type using NHibernate, you have to decide whether to implement IUserType or ICompositeUserType. IUserType is slightly simpler to implement but doesn't support using HQL for the custom types underlying properties. To use the power of HQL, you'll need to implement ICompositeUserType. I have an generic example here. Using this interface you can use the underlying properties within your custom type in the HQL ... very cool. The greates benefit of using these interfaces in ......

Posted On Monday, August 14, 2006 5:09 AM

Generic ICompositeUserType implementation for NHibernate mapping
Here's an attempt to generalize (sorry Haack) various Value Objects I need to be mapped using NHibernate. Previously, I posted an example of using the ICompositeUserType NHibernate interface for JP Boodhoo's Money example, but it becomes clear after doing a couple of these implementations that you'll get sick of the repetition. It becomes clear after doing a couple of these implementations that you'll get sick of the repetition. :) I don't fully understand a couple of the methods how they are used ......

Posted On Sunday, August 13, 2006 6:30 PM

Value Object and its collection
Here's a nifty way to build a Value Object for consumption across your app and then have access to each type as a collection. First the test: [Test] public void CanLoadStreetTypesList() { IList<StreetTypes> types = StreetTypes.ALL; foreach(StreetTypes type in types) { Console.Out.WriteLine(type.... + " - " + type.Abbreviation); } Assert.IsTrue(types.Count&g... } So basically I want a list of all the types of a StreetTYpes Value object. Here's my StreetTypes VO : public sealed class StreetTypes ......

Posted On Friday, August 11, 2006 12:39 PM

Bits and Bobs about setting up Subversion on a Windows Server and getting away from Visual Studio
I decided I was sick of Visual Source Safe so I thought I'd setup Subversion as my source control service. I knew it would take some time but there is NO way I couldn't have done it without the resources I am listing below. There were a number of things I just had to tinker with, too, to get it the way I need it so I am posting some of my discvoeries/bumps here as well. I hope these might help someone who have used similar resources but are having difficulty getting going. SETUP I read the excellent ......

Posted On Tuesday, August 8, 2006 7:10 AM

Money object and NHibernate ICompositeUserType
Wanting to create an Money object in my application, I first read Fowler's description in his PoEAA book and then looked at JP Boodhoo's implementation here. This post requires at least a look at his article. Since I am using NHibernate on my app I wanted to be able to just use the following mapping in my classes taht would use the money object in them like so: <property name="Rate" type="Data.NHibernateImpl.T... <column name="Amount"></colum... <column ......

Posted On Saturday, August 5, 2006 10:52 PM

Copyright © Mike Nichols | Powered by: GeeksWithBlogs.net