Watin is an amazing testing suite for web applications. If you have not tried it immediately go here and watch how easy it is to create end user unit tests for web applications. Now if that isn’t amazing enough there is the WatinTestRecorder. View the video here that shows how to create Watin tests for a full page of a web application in about 5 minutes.
Category: Monorail
On Monorail and why I think its great software.
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.
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:
- 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.
- 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.
- 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.