Expert to Expert: Brian Beckman and Sam Druker - Deep Entity Framework
- Posted: Dec 05, 2007 at 8:53 AM
- 26,907 Views
- 20 Comments
Loading User Information from Channel 9
Something went wrong getting user information from Channel 9
Loading User Information from MSDN
Something went wrong getting user information from MSDN
Loading Visual Studio Achievements
Something went wrong getting the Visual Studio Achievements
Right click “Save as…”
You've seen a few conversations on Channel 9 about Microsoft's
Entity Framework. Well, it's time for another one, but with a new twist...
Brian Beckman recently had a deep technical chat with Sam Druker about the Entity Framework data model and related technologies.
Sam is GM of the Data Programmability Group at Microsoft and also happens to be Brian's boss and former programming colleague. Sam's a
very technically-inclined executive... He has to be considering he's a leader in the Microsoft group that makes SQL and the plethora of data-related platform technologies, not to mention that he has to manage the likes of Erik Meijer and Brian Beckman.
This interview is great for two simple reasons. The first reason is that, well, it's a
great (and deep, including whiteboarding) conversation between experts that spans many technologies related to SQL and the Entity Framework.
The second reason is that this is the first in a series of interviews on Channel 9 that involve experts in one domain (or many domains, like Brian) who interview other experts in another domain that is not well understood by the interviewer
(so, in this case, for example, the venerable Brian Beckman really does not ask any questions that he already knows the answer to. Brian is not an expert in EF, but possesses a very unique perspective in this case given his mathematical tendencies and
expert level understanding of things like set theory...). Yours truly, Charles, takes part in the conversation of course, but I'm mainly a camera guy who throws in a random question once and a while. Brian drives this interview.
Like you, I'm in the audience and learning from people who truly understand the deepest levels of a given platform technology. Again, Brian Beckman
conducts this interview and I think this is a trend you are going to
really enjoy.
Thank you, Brian and Sam!
You'll see more of this class of interview in the future on Channel 9.
Learn. Enjoy.
Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation,
please create a new thread in our Forums,
or
Contact Us and let us know.
Follow the Discussion
Oops, something didn't work.
What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in. You need to be signed in to Channel 9 to use this feature.What does this mean?
Following an item on Channel 9 allows you to watch for new content and comments that you are interested in and view them all on your notifications page.sign up for email notifications?
Currently, I have a data access class I wrote called "StoredProcedure". I then have code generators to create the stored procedures, and the VB.NET classes. It's specific to the type of operation, such as insert, update, delete, select as output params, select multiple, etc.
Although I think it's very clean, replacing all of that with the entity framework, if it's clean and is performant, would be great.
However, the stored procedure class I created offers quite a bit and has some intelligence in it. For example, formating the sproc name, validation, not adding certain parameters if they don't pass validation and that parameter has a default, etc.
Also, I plan on adding possibly some type of load balancing to it, possibly based on the stored procedure name (or parameter specifiying read only or data is modified by this sproc), and also user based specific connection strings. (This way, for example, you can setup mirroing database, and have the read-only stored procedures executed on the mirrored database.)
I'd be curious to see if the entity framework would be able to do this as well, and\or whether or not you can inherit and modify certain objects that are responsible for this.
Thanks to all. Very informative. However I am still wondering where the business logic goes? My brain wants it to go inside the EF so I can code it in 1 place using c# (for example) and not have it sprinkled all over the client, BLL, and sprocs in the server. Is this the case? Do I use code-behind to add my BL inside the EF and it travels with the EF? If so, great, I would like to see a video on it. Also, personally, I would like to never have to switch into tsql again as I don't like moving between DSL and keeping those all fresh in my head, plus all the added complexity. Will we be able to code our sprocs inside the EF using .Net?
Also, as you hinted to. It seems to me that the model I really want is have the EF be exposed as a service on the server side. Then my client can connect to it (using Linq) using a client side EF provider. So it will look and feel like DLinq, but will be talking to EF front end instead of ADO/DB directly.
And what I "really" want to do someday is this from the client:
Future<Customer[]> f = Future.Create(() =>
{
return DB.Customers.Where(c=>c.Active==true);
});
ObjectDumper.Write(f.Value); // Wait and print active Custs.
So this "ships" the Func to the Server (i.e. does not convert to TSql). And the server processes Func directly (like a dynamic sproc). So it is like directly passing a sproc right into the server and getting results. Objects are not created or serialized until rehydrated on the client, the stream from server to client would be byte[] (i.e. not xml).
Thanks much.
I'm looking forward to more videos from Brian
Indeed. Great videos! "Expert To Expert" sounds very cool btw.
C
AWESOME! I had a "brain wave" (if you want to call it that way) a few hours ago. Why not throw a few experts together and let them defent their technology against each other? I don't know if that is doable but sounds very cool to me...
Charles sort of already did it with functional vs. imperative at JAOO. I think that could be revisited because all those guys seemed pretty set on functional languages. I want a diehard imperative guy to take on a diehard functional guy haha
I'll see what I can do
C
I hope one day to have the variety of projects under my belt Brian does
I like the format very much. Thanks
Throw in an OS expert and I'll fetch the popcorn!
Ding ding!
I just finished my part of a project and I used ORM for the first time, the Castle Project's ActiveRecord witch is built on top of NHibernate, and I really liked it for the most part.
The EF v1 doesn't do multiple data sources. Fundamentally, it does "reshape" data in a queryable and updateable way, based on the rich model described in the EDM and a set of mapping corresondences. Our core scenarios are around core data access/independence. We will bring the reshaping capability to "disconnected" (don't want to confuse with "offline") programming ala DataSet soon (in a release to be named later, barring acts of force majeure, etc, etc.).
That's an important step along the way to compositing data from multiple sources in the way you describe. Then we'd have the part of the problems that let's a programmer explain what span of data they want, when it shoudl be refreshed, how to push changes, etc. Multiple sources gets complicated with further details like cache coherence and isolation levels and transactions and all that, um, database stuff.
Thanks, me too.
The EF engine and generators have hooks to enable common validation scenarios. I can't speak to the sproc renaming off the top of my head--let me see if I can get Pablo or Tim or Steve to stop by for an answer.
One nice side effect of doing a bunch of metadata plumbing under the hood is that we can start to regain some of the flexibility with conn strs.
In my own view of the "state of the art" app model BL is specific to a tier [Don't ask me about tier-splitting yet--I'm an engineer not a scientist]. Yes code-behind for mid-tier or client logic but your sprocs are still in your data-tier with that dev environnment. Architecturally speaking, I do anticipate being able to write "BL" type sprocs in the database with Entities. Of course, you can write sprocs inside SQL Server using VB or C# today. For certain scenarios that may be a good head start.
In my experience I find schemes for"traveling code" or "code shipping" a big red flag. Distributed deployment is hard enough; adding a self-modifying aspect can get crazy pretty quick.
Sprocs are the "material in the room", as Brian would say. But I can imagine a world where the queries are shipped over directly as canonical trees. This would be like the very first SQL QP which was a new front end basically grafted into the existing QUEL pipeline. The EF architecture was inspired by that example in fact. The EF design was faced with needing to support multiple query syntaxes from day 1.
On the serialization format, note that TDS takes care of all that, just like in pre-EF ADO.NET, ODBC, JDBC, and OLEDB. Whether or not you get XML scalar types.
Small soapox moment, diving into the opening:
Of course "select c as customers where c.active" is itself not a func. It's an expression. Further, it's an expression whose evaluation can be manipulated in very interesting ways by an optimizer. Even better, it can also be composed while maintaining that set of properties. And finally, the monad itself can be treated by the language as a unit of remotability. All 4 of those things are very very good for high-performance, low-obscurity database programming.
Pass. I'm already overdue for a dunk tank (sorry Jenn).
ummm.... not for everyone
Remove this comment
Remove this thread
close