Happy New Year Everyone

I hope everyone had a happy new year and had good holidays to close out last year. I’m still working on UnityWeb I think I finally am close to grasping the last stumbling block I’ve had with NHibernate the session management of it as I’ve just learned of the conversation per business transaction pattern.

Just something I ran across today that should give everyone a brief chuckle is this snippet of code:

if (param[1].Value.GetType() != Type.GetType("System.DBNull"))

Isn’t that just some of the most beautiful code you’ve ever seen?

You can definitely file this under the Lexicon of Crap code.

2 thoughts on “Happy New Year Everyone

  1. I actually learned about S#arp Arictecture yesterday and I took a look at it and left a rather long post on Fluent NH’s discussion boards if you actually open up the S#arp project you’ll see IMO it’s death by generics.

    That everything is so over genericified that it’s so hard to figure out what’s going on. Also I’m not a fan of their domain model at all it includes marking attributes on your domain objects also I’m not really sure I agree with how they coupled their domain objects to business rules for validations either.

    I saw included in S#arp where they have attributes to handle transactions but none of their examples actually use the attributes, this is actually one idea I might steal shamelessly and couple it with the conversation per business pattern so in my presenters I can mark like

    public OnViewInitialized()

    And then I’ll be able to keep my code files looking clean even if the Attributes are really just hiding the fact I introduced DAL logic into my Presenter layer. But I feel the pollution is worth it for the such high benefit of being able to group all of my controller actions into 1 single database hit (or 0 if everything is cached up)

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s