Internet Explorer is truly evil.

I avoid web development.  It is just much more of a pain in the rear end
than it should be.  When I do web development, I test in Firefox.  I
write valid XHTML and valid CSS.  When I have to get something to work in
Internet Explorer, I curse.

So for future reference:

line:1

error: invalid character

can happen when one of the scripts which you reference does not
exist.

<script src=”scriptaculous.js” type=”text/javascript”>

oops, scriptaculous.js doesn’t exist.  Thank you Microsoft for writing
such excellent and accurate error messages.  The quality of this software
continues to astound me.

 

Windsor featured on CodeBetter

Hurray!!!

It is about time that someone other than a Castle Project contributor bloged about Windsor!  David Hayden over at codebetter.com writes about Windsor.

I can’t think of very many applications that shouldn’t be written using Windsor, and I can think of scarcely few more which should not take advantage of Binsor.  The Meticulous Geek even says “I never want to configure my container with XML again.”

Yes, I realized I just linked Ayende again.  He blushed at my last post where I summarized what I thought were the best Active Record and NHibernate related posts of the past 8 months.  It was difficult to stay on topic.  There were many other great posts, but many were about other things.

ORM vs. your own DAL with everything in Stored Procedures

I was arguing in an instant message window today. I was trying to relay the awesomeness that is Castle Project’s Active Record. I realized I’m not a very good arguer. I found myself digging for URLs which I know I had read, which do the comparison of DAL vs. ORM and dispel the myths that “you must use stored procedures for all database access”.

As I was skimming reverse chronologically through Ayende’s blog, I realized that for someone starting off, reading these things in some kind of logical order would help. I’ve decided to try to put things in some kind of order. Regarding Ayende/Oren’s blog, his really is all you need. He links to many other sites with excellent information.
So first, I’d like to try to build a case for using ORM.  I don’t have to do much, it has been done for me:

Just because you are using ORM, doesn’t mean it is magic.  http://www.ayende.com/Blog/YouCantEscapeTheComplexity.aspx  You have to still understand what is going on under the hood.  This is definitely an area in which I am lacking.

It is probably best to read Clemens Vasters post, then read Ayende’s follow ups.  They are very enlightining.  It is great to get both sides of the issue.

  1. http://friends.newtelligence.net/clemensv/PermaLink,guid,0fbf07a9-9e7a-4db4-a305-58250ac57a73.aspx
  2. http://www.ayende.com/Blog/2006/03/07/ClemensOnORMappers.aspx
  3. http://www.ayende.com/Blog/MoreAboutObjectRelationalMappersVsCustomDAL.aspx
  4. http://www.ayende.com/Blog/ClemensOnORMapeersTakeII.aspx

Don’t think DLINQ is the answer, or that it does more.  Many DLINQ fans don’t realize that most ORMs have been able to do this stuff for years.  http://www.ayende.com/Blog/UsingORMProperly.aspx

A comparison of LLBLGen to NHibernate.  Now to be fair, Oren is a contributer to NHibernate so he may be a little biased.  I’ve not used LLBLGen, but I have browsed its documentation, and I’d also rather use NHibernate.  http://www.ayende.com/Blog/LearningAboutLLBLGen.aspx

On security of the stored procedure approach vs. ORM.  This is a great detailed description.  http://www.ayende.com/Blog/OneUponATimeInAnITOperationFarFarAway.aspx

For some reason there are LIES surrounding ORMs.  Know this:  They are lies.  http://www.ayende.com/Blog/PissedOffByVanatecOpenAccess.aspx
Some people have responded to others and said “I’ll write my own!”  Oren(Ayende) gives 25 reasons not to:

http://www.ayende.com/Blog/25ReasonsNotToWriteYourOwnObjectRelationalMapper.aspx

It turns out he was repeating himself, because he mentioned it a little less detailed months before: http://www.ayende.com/Blog/YouReallyShouldntWriteYourOwnORM.aspx

A common problem to run into once you start using an ORM, any ORM, is know as the SELECT N+1 Problem.  http://www.ayende.com/Blog/CombatingTheSelectN1ProblemInNHibernate.aspx

I’ve never done this, but I should probably keep it in mind.  I’ll bet I could use it, and it is a great example of how quickly you can get things done using these tools.  http://www.ayende.com/Blog/UnderusedNHibernateFeatureCreatingObjectsInTheSelectClause.aspx

I haven’t even read these yet. How could I have missed them?  They go into how it works.
All you wanted to know about Castle’s ActiveRecord – Part I
All you wanted to know about Castle’s ActiveRecord – Part 2

Finally, there is a whole series of posts building up a demo app, including using Brail for MVC.  This is ActiveRecord + MonoRail stuff, a great way to see the big picture.  http://www.ayende.com/Blog/CasleDemoAppMidwaySummary.aspx
A couple of items which I think are worth reading, but I couldn’t fit into this semi-ordered list of links.

  1. http://www.ayende.com/Blog/AFewWordsAboutTheDecoratorPattern.aspx
  2. http://www.ayende.com/Blog/AdvancedUsesForORM.aspx
  3. http://www.ayende.com/Blog/ComplexSearching.aspx
  4. http://www.codeproject.com/aspnet/NHibernateBestPractices.asp
  5. http://www.codeproject.com/cs/design/IntroducingCastle.asp
  6. http://www.codeproject.com/cs/design/introducingcastleii.asp

Once you are familiar with the ActiveRecord library, I highly recommend checking out the rest of CastleProject.  Windsor is awesome.  MonoRail is ASP.NET on steroids.

Locales, Postgresql and Ubuntu

Somewhere along the path of running Ubuntu unstable and its postgresql-8.1 packages, the locale which the main cluster was built with was en_US. But this was not the UTF8 variety of en_US, it was(is) the ISO-8859-1 variety of en_US. Well, somewhere along the way Ubuntu started defaulting to making ONLY the en_US.utf8 locale when the locale package is installed. This lead to some ugly strange errors when trying to start the postgresql server.

Error: The server must be started under the locale en_US which does not exist any more.

It is troubling because the en_US locale DOES exist, and the start scripts automatically set the locale properly. The issues is that en_US.ISO-8859-1 does not exist, but that en_US.UTF8 does exist. The solution is a simple command, but it wasn’t so simple to track down.

sudo apt-get install language-pack-en-base
sudo locale-gen en_US
sudo invoke-rc.d postgresql-8.1 start

Agile good vs. bad. I win!

I honestly can’t tell if Stevey is serious or not, but I
love this post anyway.

I was chuckling inside the whole read, but this made me laugh out loud.
“I
was really curious, in part because I’d consented to try Agile last Christmas
(“hey, it can’t hurt”), and wound up arguing with a teammate over exactly what
metadata is allowed on index cards before giving up in disgust.”

http://steve-yegge.blogspot.com/2006/09/good-agile-bad-agile_27.html

By the end of the read I could tell that he is indeed serious and he raises
some awesome points.  This is the first writing I’ve ever read that said no
to Waterfall, Cowboy and Agile.  YEEHAW!!!


Metadata-Based Validation

This Artima article links to an IBM developer works article which details how validation in
one place in an application can extend throughout different parts of the
application.  I’ve wanted something like this ever since I played with
Modula-3 in college.  Modula-3 made it so easy to create new constrained
types that I finally saw the power of such constraints.

My dream of a system would work something like this:

1.  Define your data objects and include something which contrains this
data.  In Java this could be annotations.  In .NET this could be
attributes.  In other languages, or pre-annotations Java, it could be
something else, it doesn’t matter, but annotations/attributes definitely make
things easier and nicer.

2.  If I am mapping to a database, the ORM should read these attributes
and contrain the data at the database level.

3.  If I create a UI (web, console, windows, gnome, applet, it should
not matter) certain control types should be infered and other control types
should be validated.  For example, if I have a data member which is an
enum of three values, a textbox is probably not the best input control.  A
drop down with three values, or three option boxes may be better.

4.  If I create a non-U-I (a non-user Interface) (web service?) the
contraints should be enforced, preferably at the service layer.

I would really love this.  Scaffolding would be far more useful with
this type of Metadata in my objects.  People directly accessing underlying
databases have less chance of inserting or modifying data to “garbage”. 
Contraints were pushed down to the database level.  Of course, ideally no
one would connect to the database directly, but the real world is not ideal.

http://www.artima.com/forums/flat.jsp?forum=276&thread=175992&start=0&msRange=15

http://www-128.ibm.com/developerworks/java/library/j-hibval.html

AADND – Ann Arbor Dot Net Developers meeting September 13th at SPARK

Please join us on Wednesday, September 13th at SPARK for the 8th Ann Arbor Dot Net Developers meeting.  The meeting starts at 6pm and usually lasts until about 8:30pm.

Jay R. Wren (me) will be presenting Mono.

Mono yields some great opportunities to propel Open Source and Linux even
further into the mainstream. Mono is an Open Source implementation of a
runtime environment and libraries designed and created by Microsoft known as
the .NET Framework. There has been much controversy and misinformation about
its performance and licensing issues in the Open Source community. Some of
these issues will be dispelled and others will be displayed in a new light.
Some of the best desktop application available today are written in C# and
run in Mono. Mono has some excellent tools available, some of them are
better than tools available for systems which have been around much longer.
Mono supports nearly all of the protocols and libraries with which Open
Source developers are familiar. In this session, we will introduce Mono.

Jay R. Wren learned to program at age 8 on an Atari 800XL. Two years later
the family got an Amiga 1000. He learned to program structured procedural
basic. Amiga Basic 1.3+ didn’t have line numbers! This background helped
immensely when he moved to programming PASCAL and C and later C++, Java,
Python, PHP, Perl, Pike, and finally C#. He started using Linux as a desktop
operating system in 1995. He put himself through Oakland University for
eight and a half years and obtained a bachelors and masters degree while
working, usually full time. After seven years of working as a Systems
Administrator and a Network Administrator, Jay decided to switch direction
slightly and put the computer science degrees to work by entering the field
of Computer Programming and Software Engineering. After trying to teach
himself the whole J2EE thing, frustration with the XML configuration files
and overall system lead him to try this Microsoft .NET thing. Very shortly
he was hooked and diving into the open source implementation of it, called
Mono. He has been using Mono and .NET since fall of 2004.

We will have our usual format including valuable news about local .NET technology, opportunity and jobs.  Pizza will be privided.

This meeting is open to the public and is free to attend.

For more information see our website:  http://www.aadnd.org/

Domain Driven Design (DDD) and Service Oriented Architecture (SOA) are both important

Alex Hoffman gets it!

DDD and SOA Are Unrelated.

I don’t think I would use the word unrelated, but the are definitely NOT two different ways of thinking. I guess this is a pet peeve of mine. DDD is also not a replacement for Object Oriented Design. Rather, DDD “is a way of thinking and a set of priorities…” according to http://domaindrivendesign.org/.

Domain Driven Design as the primary driver to solving a problem. SOA is simply a set of guidelines for best exposing this solution. I wouldn’t say that they are orthogonal. I might say that they are parallel. I wouldn’t say that they are totally unrelated, but I would say that they are independant of one another. However, the ease of exposing your design as a service would be a reflection on the design of your domain so there is some intrinsic relation there.

Both of these items should be on the checklist of “good software” when designing a new application or system. It is fine to simply say “no, we won’t ues that” to each of these items when going down the checklist, but in my opinion they should at least be considered for each and every project.