Frans Bouma's blog

Generator.CreateCoolTool();

Syndication

News




    Add to Technorati Favorites

About me

Fun stuff I created

My work

My interview with DotNetRocks! is now online!

My interview with .Net Rocks! is now online! . Please use this link to to get to the show's page.

Carl and Richard were great, the interview was a blast although I was pretty nervous at the beginning. I hope to talk to them in person at the SDC this fall in The Netherlands.

Enjoy!

Published Thursday, May 31, 2007 12:15 PM by FransBouma

Comments

# re: My interview with DotNetRocks! is now online!@ Thursday, May 31, 2007 8:52 AM

About frickin' time they interviewed you! Good - can't wait to check it out.

Sahil Malik

# re: My interview with DotNetRocks! is now online!@ Thursday, May 31, 2007 3:02 PM

Good interview! I'm a bit confused on one of your answers about lazy-loading though... Why can't lazy-loading use the repository to get its data?

Mike G

# re: My interview with DotNetRocks! is now online!@ Thursday, May 31, 2007 4:08 PM

Mike: it can only use a repository if the collection exposing property calls into the repository.

Take for example Customer.Orders. When I do:

Orders myOrders = myCustomer.Orders;

if(myOrders.Count>0)

{

myOrder = myOrders[0];

}

(bogus code, but you get the idea ;))

In the example, the Orders property is a property which exposes a collection which is lazy loaded. Typically, an o/r mapper will make sure that this is done automatically, so if you touch that property, it loads the data.

However, Order is an aggregate root. So typically, it should use the Order repository to fetch the orders for that customer, not a query formulated by the o/r mapper based on the  access of the property.

To implement that, you effectively have to throw away the mechanism that's introduced by the o/r mapper to make lazy loading possible, hence the bypassing.

FransBouma

# re: My interview with DotNetRocks! is now online!@ Thursday, May 31, 2007 6:14 PM

"So typically, it should use the Order repository to fetch the orders for that customer, not a query formulated by the o/r mapper based on the  access of the property."

I guess thats my question. Why can't the call from the Orders collection use the Order repository with something like:

Me.Orders.Fill( OrdersRepository.GetOrdersForCustomer(Me.Customer_ID) )

?

Mike G

# re: My interview with DotNetRocks! is now online!@ Friday, June 01, 2007 3:27 AM

Cool Frans! It was a lot fun finally hearing you with the guys :-) When can you do this talk for the usergroup? This fall maybe?

Dennis Vroegop

# re: My interview with DotNetRocks! is now online!@ Friday, June 01, 2007 5:58 AM

Mike: Sure, but that circumvents the lazy loading functionality provided by an o/r mapper and effectively makes YOU the one writing the lazy loading code. :)

take for example a POCO using o/r mapper: it will likely replace your List<Order> collection with their own collection and override the Orders property with their own code in a dyn. proxy class which will make sure the lazy loading code of the o/r mapper is performed when the property is read. So working around this is of course possible but you then actually don't have the lazy loading ofthe o/r mapper but you've to build it yourself. This is kind of tricky though: for example you only want to call into the repository the first time, the second time you just want to return the entities you read the previous time instead. So you have to have flags as well which track this. :)

Dennis: Thanks :) What kind of talk did you have in mind exactly? (as this was an interview ;))

FransBouma

# re: My interview with DotNetRocks! is now online!@ Friday, June 01, 2007 6:33 AM

You could let the O/R Mapper know about the repositories, of course. It might even be a nice type of plugability point. Hmmm. Something to think about. :-) It would not really reduce the work of the O/R Framework because behind that repository, in all likelyhood you would find the O/R Mapper again...but it would mean that it would be easier to integrate the mapper with a popular architecture style. Again hmmmm. :-) Perhaps the weekend is saved then! ;-)

Mats Helander

# re: My interview with DotNetRocks! is now online!@ Friday, June 01, 2007 7:21 AM

The nervousness at the beginning resulted in a lot of uhm's but it got a lot better later on ;). Was fun to hear you talk about ORM and software development in general !

Eric

# Frans Bouma on .net rocks &laquo; EricDotNet@ Friday, June 01, 2007 12:15 PM

Pingback from  Frans Bouma on .net rocks &laquo; EricDotNet

Frans Bouma on .net rocks « EricDotNet

# re: My interview with DotNetRocks! is now online!@ Friday, June 01, 2007 5:41 PM

Looking forward to listening to it. I was wondering where the LLBLGen love was in their recent ORM focus.

Arne Claassen

# re: My interview with DotNetRocks! is now online!@ Sunday, June 03, 2007 10:32 PM

Really good interview Frans.

I always knew you were a smart guy -- but until I heard this interview I didn't realise you were such a level-headed and friendly guy with a good sense of humour.

It's great hearing someone interviewed who you've only read before -- it reveals their personality better than just writing.

So thanks for taking part Frans.

best of luck.

lb

lb

# re: My interview with DotNetRocks! is now online!@ Monday, June 04, 2007 2:47 AM

Thanks lb and others for the great comments! :)

FransBouma