SubTyping in ActiveRecord isn’t too clear.

I’ve spent quite a lot of time messing around the methods for subtyping in ActiveRecord.  The clearest method I’ve found is using concrete classes (what Fowler calls them).  For this to work you simple have a inheritance relationship between the base type and the subclasses and have the AR attribute on all the classes (I get a weird error if the base class doesn’t have this attribute).

E.g. 
[ActiveRecord(“BaseType”)]
public class BaseType
{}

[ActiveRecord(“FirstSubType”)]
public class FirstSubType:BaseType
{}

[ActiveRecord(“SecondSubType”)]
public class SecondSubType:BaseType
{}

You end up with a little bloat in terms of sourcefiles and database tables, but, at least you have a very clear subtyping relationship.  I had wasted a lot of time with the AnyToAny relationship syntax.  Note:  There is no documentation whatsoever for how to use AnyToAny relationships in AR.  I reccomend searching the Subversion repository test cases for examples of how to use that.  Even the forums lacked any good description of how to code it.  Honestly this is one of those features that I would almost switch to NHibernate if I can’t work it.

Beautiful Things

For those folks who know me, I hope you still consider me a friend since I have pretty much disappeared off the face of the earth in the last six months.  It seems a lot has changed in my life in the last six months.  Someone has entered my life that has really made a difference.  I have been keeping a low profile for the last 3 years, but, I am really low profile nowadays.  I basically save all my time for work, her, and school.  Really its all about her.  We are coming up on six months now and I am trying real hard not to seem to talk about nothing but her.  This past week I have been reminiscing on how things are different for me now and how much I love having her in my life.  I know I usually talk about software in this blog, but, this post is a little different.  I love her.  She makes me as happy as any well written code.  These things are not comparable I suppose, but, when I think of things that make me smile she always comes to mind.  There was a time in my life when software was all that came to mind.  Looking back I can see how I must have missed the point of a lot of things.  Believe me when I say the right person can truly change your life.  I don’t know the audience for this blog, but, if she sees this I just want her to know that I care for her deeply and want to have other things to say about her another 1000 six months from now.

More on Monorail

More on Monorail

         

Why are people still using ASP.Net WebForms?

 

Finally cooking with Monorail and ActiveRecord has come to the party.  Can’t believe that I just got log4net working yesterday and I’ve had log messages  in code from the start.  Turns out that you have to take the log4net config out of the web.config and put it in its own log4net.config file in the same directory as web.config.   I still haven’t figured out how to turn on event logging appender yet, but, I’m fine with file logging for now. 
Man, when it all comes together its a thing of beauty.  I’m making use of the paginationhelper now.  I have to use the caching one because of multiple search params, but, I could get away w/out the caching one if I had to.  I should be able to get deep into the SCORM stuff later today after cleaning up one or two things.  I’ve been mostly happy with everything except that I’m using sourcesafe.  2007 and Sourcesafe is still a hot mess.  On the next project, I’m definetly switching to subversion.   Friends don’t let friends sourcesafe. 

TDD in Monorail

I’ve heard a lot of weird things about TDD in Monorail.  As a bastard child (open source project based on closed source technology—can you please open source C# please MS) project Monorail comes with its own gotchas.  So far I have discovered two problems that I have worked through.
1.  For whatever reason, you are stuck with the version of Nunit that the Castle distribution comes with.  You can get the source and try to figure out whats broken here, but, if you encounter strange exceptions when running tests in Nunit-Gui then a likely cause will be that you’re Nunit-Gui version and the Monorail version of Nunit do not match.  I consistently got a “accessing an unloaded appdomain” exception.
2.  Make sure that anything stored in property bags is serializable.  This was a weird one, being that the actual exception ends up being “System.IO.FileNotFoundException : Could not load file or assembly.”  In reality I discovered that a call to AssertPropertyBagContains was failing because an item I was storing in the propertybag was not serializable.  Easy fix for this is to add the Serializable attribute to the class and check for any custom Serialization stuff (changing collections to list and dictionary should fix problems with serialization).

Thoughts on software

.Net web development frameworks

         

Why no one uses webforms

Castle Framework   Who gives a damn about viewstate

Went through the usual suspects.  I was looking for something that supported MVC, TDD, domain driven design and had nhibernate support.  Castle handily has support for all this.  Took a look at the spring project, but, I’m not that into aspect oriented (Can you name one major aspect oriented developed project?).  Are there too many frameworks and methodologies out there?  There is one train of thought that anything worthwhile is necessarily simple in its makeup and explanation.  I agree with this except I don’t think the proper methodologies are emphasized in computer science.  People are very caught up in buzz words, but, they don’t realize that there are a lot of people working on ways of making their work easier and worthwhile.  That it comes out in a variety of shapes and forms, is not an indication of merit, but, a reflection of how many smart people there are working on all this.  A few things that can help the development of maturity in software engineering:

  1. The cathedral and bazaar conflict has to leave the software engineering mindset.  This is a concern that is outside of our work.  We make the products.  Let the bankers, financiers and the like figure out how to sell it.  Software Engineers can no more impact the software engineering marketplace than automotive engineers can impact the automotive marketplace:  sure, we can design new forms and create new trends, but, when it comes down to it, its all about what some individual wants and how much they are willing to pay for it.
  2. The software engineering licensing movement has to move forward.  There are too many kids with bazookas out there.  In the last 60 years we have managed to create a wasteland of broken promises and even more broken systems.  A certain seriousness has to enter into the approach to software development.  Every day, system criticality increases as IT drives more and more of human endeavor.  We have to get serious about creating good software and to do that we need good software engineers.
  3. Intellectual property has to be recognized as an asset of the species rather than as corporate asset.  This may seem to contradict point one, but, let me clarify.  I said nothing about making all software free.  I believe developers should be paid for their work.  However, there must be a new model for what happens to software once its developers have received payment for their work.  Perhaps, we should all agree on some fair use clause that kicks in after X amount of years.  I am very opposed to the idea of perpetual copyrights to software.  Software has to be seen as a human intellectual product.  As such, it should only be protected for a limited amount of time and then released like all other human intellectual products.  The benefits to humanity of fair use far outweigh any financial incentive that any single developers every see in their lifetime (Bill Gates included).  Of course, this may mean a radical adjustment to the economic model for software.  However, this is happening as we speak anyway.  Software as a Service is the latest incarnation of transformations that are already happening. 

Got my subtext blog up

Subtext is Live

         

Why your isp sucks

While working on thesis first post   Virtual Dedicated Hosting

Subtext is a nice little project The wysiwyg kinda sucks though. I guess they want you to use IE to use this.  No way thats gonna happen.

Anyways, had to install SQL Server Express Advanced Services.  That is some nice software.  Like everyone expects MS is forced to go more and more open source/free with everything.  If I can get Mysql for free, I should definetly be able to get a version of MS SQL for free. 

I can’t stand these old things that people are used to using forever, but, never look into why and how.  Asp.net connection strings is an example of that.  Rather than fix the inconsistencies, MS prefers to make them dumber and dumber for each release.

At some point I am going to take a good look at boo (especially if I use it for my views for monorail).   Dudes write up on his site sounds like an old fashioned communist manifesto:)