Extending NHibernate data with one-to-optional relationships

, , , 9 Comments »

It’s been said that ninety percent of the time you think there is a one-to-one relationship in NHibernate it’s really a many-to-one. I’ll agree with that. But this post is about one of the ten-percent cases when a single entity spans several table schemas.

So the scenario is one where you have a thing that can be extended with additional data. And capabilities, of course, but this post is just about the data. In a traditional app it’s very straightforward to add additional fields when a new feature is added.
Read the rest of this entry »

Spark in the Field - Fancy Dress Outfitters

, , , No Comments »

fancydressoutfitters This post is really far overdue - I’ve been pretty busy. This site has been live for quite a while, over a month now at least? The first I heard of this site was when Howard van Rooijen sent a message to the Spark dev group.

In the thread Howard says, among other things:

For those who are interested - here’s a little more info:

- We ran the project using Scrum and delivered in 20 weeks: 10 x 2 week iterations
- It’s based on the S#arp Architecture framework, which we extended to support Spark and ViewModels
- Integrated other OSS projects into the solution the one most relevant to Spark being N2CMS
- Solution performs very well: 1000 concurrent users per web server, generating around 180 pages per second across 2x single quad core 64bit servers.
- The site has a YSlow B Grading.

Very nice. His associate James Broome also has a post talking about their project as it relates to Asp.Net MVC – Separation of concerns amongst team members. You’ve gotta love hearing real-world examples of where UI-centric concerns and coding-centric concerns can work together in the same space at top speed without stumbling over each other’s focus.

Injecting an ILogger property with Autofac

, , 5 Comments »

I’ve always liked the Castle.Core ILogger and ILoggerFactory abstraction. I don’t know why but I’ve never been a fan of log4net so I like to keep direct dependencies to it at arm’s length.

Looking into Autofac recently, I was trying to find a way of getting a logger property assigned as a component is created from the container in the same way as Windsor’s logging facility. The Autofac container has a Module/IModule extensibility which works well for the tasks a facility would have done.

Here’s the type of code I’m used to seeing from logging.

using Castle.Core.Logging;

namespace LoggingStudy {
    public interface IFoo {
        void Bar();
    }

    public class Foo : IFoo {
        public Foo() {
            Logger = NullLogger.Instance;
        }

        public ILogger Logger { get; set; }

        public void Bar() {
            Logger.Info("Bar called");
        }
    }
}

Read the rest of this entry »

Herding Code podcast about Spark

, , , , 2 Comments »

Herding Code The Herding Code 60: Spark View Engine with Louis DeJardin podcast just went up. Really fun group of guys. Interesting process they use to record also and seemed to work really well. I can just never get used to the sound of my own voice.

Memory pressure and scale

, 1 Comment »

This is an open question really for people that make, use, or host ASP.NET apps… When you’re choosing a technology stack how important are memory pressure concerns?

So if you’re looking at adding automapper, or nhiberbate, or ioc xyz, you’re obviously going to be thinking about impact to CPU and memory.

And there are two type of memory impacts: load-and-hold and burn-rate (or memory pressure). The first is relatively easy to say you’re using ten megs of one-time cost memory in each appdomain once it’s initialized and warmed up. The other’s a bit more subtle - if a tool goes through a two megs of object, string, collection, buffer memory in a request - and say you’re tooling along with bursts of 25 req/sec - then 50meg/sec means you’ve given the garbage collector a gig of ram to recycle every 20 seconds. Numbers and needs vary but you get the idea that high burn rates end up causing a CPU tax to be paid affecting the net power availabe.

But on the other hand dotnet is a high level language, and a lot of there types of things are developer productivity tools - not performance tool - so they will *always* have measurable increase in cost. But in the most extreme cases, like from he point of view of a hosting company, you could almost assume that memory efficiency is directly proportional to hardware, space, and power costs per client…

Not that it’s a black and white situation, of course, but at what point are the conveniences and strengths of a library outweighed by the cost of using it? Of course it’s always difficult to weigh something subjective against something quantifiable.

But what’s your take on that?

Building 42

4 Comments »

ms_net_rgb_web The first blog post was keyed in from a mobile phone before new employee orientation, so I thought I would take a moment to write a more thoughtful post about the first few days. Well, maybe not more thoughtful… But at least a post that has some links and images in it.

For example, Building 42! My new home. I swear walking into the campus this morning I couldn’t keep the grin off my face.

building42

Let’s see… What else is there. Ah! There are people in the building! To name a few there’s Bertrand Le Roy, Renaud Paquay, Bradley Millington… Ah, well. I’m not having much luck finding a public internet presence for a lot of people so I’ll leave off with the naming of names in case they prefer anonymity. There’s also people like Scott Guthrie and Phil Haack but that would be like pointing out the fact there are roads and trees around the building.

I’m actually feeling really good about the decision to join Microsoft. Met the team, surrounded by blindingly smart people, workstation fully installed, two beautiful monitors showed up today, getting a handle on where the project is at and where it’s going. End of the second day and it’s time to head home now.

Huge changes. Thrilling and stressful

, 25 Comments »

It’s another one of those self-titled Where’s Lou posts today! So - where’s Lou now? New employee orientation in Washington! And Brenda’s still in Florida at the moment so the DeJardin household is about as geographically distributed as we’ve ever been. :)

The big news today is I’ve accepted a position at Microsoft, which is the final realization of an ambition of mine which started a year and a half ago. What hooked me then was watching the open style of development the ASP.NET MVC team was embracing and the great results and positive community feedback they were getting. I though to myself, if there was someplace you could choose to work that would be it.

I should add I’m not on the MVC team, but since I don’t know what’s public knowledge yet or not - please forgive me being vague.

Plus if anyone’s curious this doesn’t change the status of Spark regarding license, source, distribution, etc.

But yeah! Exciting! I have to finish up now and grab some coffee and prepare myself for a day of paperwork and hr presentations. Woohoo!

GenCon 2009

, , 1 Comment »

Where’s Lou at the moment? Indianapolis! Specifically GenCon 2009.

Today was the first of four days. Played a BattleTech bootcamp with Alex, some nostalgia there for me because that’s a game I the old group in high school used to play as well. He loved it - we’re going to be getting the intro box set when we get home.

Also signed up for an interactive action game TerrorWerks. Lots of fun. Three groups of five players armed with the soft yellow pellet assault rifles on an mission in a background that reminds you of the Aliens movies. I was an engineer (or course) and near the end of the mission was severely wounded and out of ammo, and eventually died trying to pull someone back from the end of a corridor where he was bleeding to death. Yay!

Going to run now to and catch an anime “Berserk” being screened. :)

Beginning ASP.NET MVC 1.0

, , , 1 Comment »

beginning-aspnet-mvc

I had the opportunity the other day to read through Beginning ASP.NET MVC 1.0 written by Simone Chiaretta and Keyvan Nayyeri. I like how it’s structured if you may be learning about the concepts from scratch.

The first I had heard about the book was quite a while ago when Simone sent me a few questions about Spark. In the later chapters about extending ASP.NET MVC there’s a small section that describes various alternate view engines. I have to admit that’s the first place I flipped to. :)

I especially the fact that after covering the basics early on almost sixty pages are dedicated to unit testing concepts and it’s implementation for MVC applications. A lot of times in demos and articles even though the importance of testing or TDD is stressed it seems like you don’t walk away with something actionable if you’re new to those practices.

Also ends with some real-world samples… Ah - and all of the code is downloadable from wrox.com. Very nice.

Spark output caching

, , , , 14 Comments »

scalesJust finished writing the documentation for the most recent feature added to Spark. It provides output caching for sections of a template that could be costly in terms of rendering or data acquisition.

Part of this comes back to Phil’s blog post about Donut Hole Caching in ASP.NET MVC. Especially below where he writes, as he’s thinking out loud, “This would have to work in tandem with some means to specify that the bit of view data intended for the partial view is only recreated when the output cache is expired for that partial view, so we don’t incur the cost of creating it on every request.”

I have to admit I’m not necessarily a huge fan of the built-in ASP.NET page caching directives… Also didn’t particularly care for the forced alignment of partial-boundaries and cache-boundaries. I would hate to have a larger number of smaller files on disk simply because that’s the breakdown at which I wanted to cache the individual parts. In an ideal world I would like to be able to quickly and easily mark an expensive bit as cacheable, and provide the caching details that relate specifically to that bit, and be done with it.
Read the rest of this entry »

Design by j david macor.com.Original WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in