
Microsoft Open Sources their Entity Framework ORM - jmcqk6
http://www.hanselman.com/blog/EntityFrameworkMagicUnicornAndMuchMoreIsNowOpenSourceWithTakeBacks.aspx
======
cek
This makes me even more bullish on Xamarin/Mono. As Miguel de Icaza of Xamarin
tweeted this morning after this was announced: "Wow @scottgu announces that
Microsoft open sourced the Entity Framework, Mono's Achilles heel"

I believe if you are building mobile clients and need to target more than one
platform you should do your UI with the native APIs on each platform, but
should use something like Mono to achieve as much code-reuse as possible for
the lower layers of your app.

~~~
untog
It is crazy how C# is one of the few languages you can actually use to develop
both iPhone and Android apps (as well as WP, obviously). It's a great
language- I just wish that a license for MonoTouch didn't cost $400.

Also, does anyone know how to develop for MonoTouch using Visual Studio? I
want to like SharpDevelop but I just can't... and of course, VS doesn't run on
OSX.

(I haven't tried SharpDevelop in over a year- it might be dramatically better
these days, but I don't think so)

~~~
ColinDabritz
To be clear, I assume you are asking about developing for iOS using MonoTouch
and VisualStudio. Android development is in Visual Studio natively.

Apparently you can do some development, but you can't compile in Visual
Studio.

[http://escoz.com/blog/developing-with-monotouch-on-
windows-a...](http://escoz.com/blog/developing-with-monotouch-on-windows-and-
visual-studio)

So you get Visual Studio, Intellisense, tools like Resharper, but you can't
quite build, because of missing elements. The build process would be to swap
over to the Mac side to build and simulate.

Not perfect, but it's nice to know it's there.

------
modarts
Despite my usual complaints about Microsoft, I really appreciate the direction
they've been heading with their adoption of open source for a growing number
of their products.

ScottGu, Hanselman et al. really deserve a lot of credit for the big cultural
changes they've caused to allow a lot of this.

~~~
danieldk
Indeed, it's also great to see that they are starting to use more widely
accepted open source licenses, which as the Apache License (as was also the
case with ASP.NET MVC).

------
outside1234
Its hard for me to say this in some ways, but of the bigcos, I'm most bullish
on Microsoft. I might actually go stand in line (if there are any) for the
Surface tablet and maybe even a Windows Phone 8 device.

They are (finally) making the right moves and doing it in a consistent and
open way. Any Microsoft insiders know who is driving all this change? ScottGu?
Steven Sinofsky?

~~~
ams6110
Seems more like a desperation move to me. Microsoft have almost no presence in
popular web apps or mobile. Almost no startups or established services use the
Microsoft stack. Maybe they think that by open sourcing they will get a look
by devs/shops that would never have considered them before.

I still think it's a long shot. The best development platform for .NET is
Visual Studio and Windows. And the "cool startups" all use Mac OS or Linux.

.NET has been sold as an enterprise platform since the beginning. That's what
it's thought of by most people, and I don't really see this changing anything.
Windows Phone is way late to the party and isn't going to do anything
significant in the market. Microsoft will continue to be primarily a platform
for building enterprise-type CRUD apps.

~~~
mythz
Note: only their Azure + DEV arm is OSS happy - which is a result from making
money with it on Azure.

Their Windows/WP/UI projects are violently closed source, almost all cross-
platform Rich/UI initiatives have been killed since Sinofsky has taken back
the helm. Personally they should do all C#/.NET devs a service and provide
better integration/code-reuse with MonoDroid/MonoTouch, but as they don't see
it in their best interest they're pushing for platform-lockin. Which is a
strange play when you're hopelessly behind the incumbents.

This is starting to be a real problem for .NET devs now (since MS is losing
their influence) as they become pawns in Microsoft's platform strategies,
whilst we (C# devs) miss out on the most exciting platforms Microsoft doesn't
want you to develop for, e.g: iOS/Android, NaCL, Unity3d, RaspPi, etc. We're
just lucky Mono exists which runs on all these platforms.

~~~
barista
"mythz", Merto style apps can always be done in HTML5, CSS,
[http://msdn.microsoft.com/en-
us/library/windows/apps/br21138...](http://msdn.microsoft.com/en-
us/library/windows/apps/br211385.aspx) so I am not sure why you say that the
cross platform rich initiatives have been killed.

More details: [http://www.winsupersite.com/blog/supersite-
blog-39/windows8/...](http://www.winsupersite.com/blog/supersite-
blog-39/windows8/free-microsoft-press-ebook-preview-programming-
windows-8-apps-html-css-javascript-143329)

~~~
mythz
"This couldn’t be further from the truth. The use of HTML5 + JavaScript in
Windows 8 is about as proprietary as using XAML + .NET."

[http://dougseven.com/2011/10/24/language-choice-in-
windows-8...](http://dougseven.com/2011/10/24/language-choice-in-windows-8-is-
not-about-portability/)

Just because it uses JS doesn't mean its portable! It has proprietary APIS +
hooks making it non portable.

~~~
shanselman
That's no different from using HTML5+JavaScript against browser specific APIs
or using CSS3 vendor prefixes. Calling external stuff from JavaScript (even if
that external thing is Windows itself) is not new and it's not bad that it's
not portable any more than writing XUL wasn't portable.

~~~
mythz
If there's no equivalent work around it's not portable - simple as that.
Proprietary hooks and APIs aren't evil, but suggesting developing for Metro is
"open" and portable is wrong.

Since you've mentioned it, Mozilla isn't touting to use XUL for "open" cross-
browser apps - although XUL itself, unlike anything Metro, _is_ open source
and does run cross-platform. Mozilla is even deprecating the use of XUL for
its new Firefox OS (Boot to Gecko) in favor of using pure HTML5 instead. Maybe
MS can work together with Mozilla and come up with a common API?

~~~
mythz
>> And Boot to Gecko will no doubt use lots of Firefox OS specific stuff just
as WebOS does.

Where did you hear that? everything I've heard is the exact opposite:

[http://www.geek.com/articles/mobile/a-deep-dive-into-
mozilla...](http://www.geek.com/articles/mobile/a-deep-dive-into-mozillas-
boot-to-gecko-project-20120510/) >> Everything is HTML5 >> The core to the
Boot to Gecko project is the web. Everything you see — right down to the power
icon and network status information — is generated by and displayed with
HTML5. The icons for the apps, the apps themselves, and the notifications the
apps generate… all HTML5. Even the Dialer and the Settings for the device are
handled this way.

<http://en.wikipedia.org/wiki/Firefox_OS> >> Firefox OS (formerly Boot to
Gecko, B2G) is an open source operating system in development by Mozilla that
aims to support HTML5 apps written using "open Web" technologies rather than
platform-specific native APIs. The idea is essentially to have all user-
accessible software running on the phone be a Web app that uses advanced HTML5
techniques and device APIs to access the phone's hardware directly via
JavaScript.[2] It initially targets Android-compatible smartphones.

The difference is Firefox OS is building as much as they can (everything?)
with HTML5, Whilst all Metro's advanced functionality is hidden behind
proprietary APIs - The comparison of "open-ess" between the 2 is not even
close.

~~~
shanselman
What existing "HTML5 API" is going to give you network status and power icon
info? Of course everything will be HTML5/JavaScript/CSS just like Chrome OS,
but the fact remains that that functionality doesn't exist in the W3C specs as
they are.

Checking out the Mozilla Docs at <https://wiki.mozilla.org/WebAPI> it appears
that these "privileged" APIs are extensions, as they should be. For example,
navigator.fm.antennaAvailable is to control the FM Radio.

------
flyinRyan
Is Entity used a lot? We looked at using it but it seemed to be inferior to
NHibernate (don't remember details, think there was a problem with type error
detection and other stuff).

~~~
gecko
I don't like it, and we don't use it at Fog Creek, but, yes, it's VERY heavily
used on piles of projects I know. It's not as efficient or flexible as
NHibernate, but it's far easier and vastly better integrated into Visual
Studio, making it a bit of a no-brainer for simple persistence needs.

~~~
kamau
So, what do you guys use at Fog Creek. I've been discussing with my colleagues
some of the micro-ORMs like Dapper, Massive, or PetaPoco as an alternative to
EF.

<http://code.google.com/p/dapper-dot-net/> <br/ >
<https://github.com/robconery/massive> <br/ >
<http://www.toptensoftware.com/petapoco/> <br/ >

~~~
jmcqk6
I don't know what they use at Fog Creek, but I will say that I've been
building a lot of things lately in both Massive and PetaPoco, and I've really
enjoyed it. I've done several projects in both Linq2SQL and EntityFramework at
this point, and they both seem way too 'heavy.' Writing straight sql (or
pretty much straight sql) has been a return to simplicity. it's forced me to
make sure my queries are efficient, and only return what they need to return.

I do miss using Linq to query the db, but not enough to make me go back. I use
EF in my main job, and while it does the job, sometimes I find myself being
constrained by the framework. That's not an issue with EF so much as it is an
issue with any kind of ORM.

~~~
IanDrake
Been having a lot of success with Massive myself. How's using PetaPoco? Any
frustrating gotchas?

~~~
jmcqk6
PetaPoco has been excellent so far. I really like being able to easily switch
between dynamic and strongly typed results. If you're not doing "Select * on
<table>" the dynamic result is pretty necessary.

I do see where there could be some ways to improve querying the database where
you're doing a lot of joins or returning data that is not limited to the table
design at all.

------
tarr11
Interesting that they put this in a Git repo (instead of TFS), but only to
then push it to CodePlex (instead of Github)

~~~
px1999
I don't have any proof to provide (and if I did, it would all be anecdotal)
but I've heard rumours that Microsoft are planning on breathing life into
codeplex and have an exciting/significant set of changes in the pipeline
(which should improve on some of the things that make using DVCS painful).

Considering Team Foundation Service, project Kudu/Git deploy on Azure etc. it
makes sense to think that Microsoft are making a play to seriously take on
GitHub and Atlassian, so that they're the one provider that owns an entire
software ecosystem, end to end.

Either way, I don't think that the EF team would have had a choice on where to
host it...

~~~
yxhuvud
What things are making DVCS painful?

~~~
glhaynes
Usability. [Which isn't to say that there aren't great front-ends, but just
that DVCS has a reputation for poor usability and a Microsoft solution that's
pretty good and easy to use (especially for TFS users) would likely be well-
received.]

~~~
teyc
I have to use TFS at work. I have to say SVN is much nicer.

------
mythz
EF is another overly architected + bloated fx from Microsoft. It's over 12x
slower than other Micro ORMs like Dapper + OrmLite - Benchmarks at:
<http://www.servicestack.net/benchmarks/#dapper>

The benefit of Micro ORMs is that they bind to clean re-usable POCO's (which
by nature can be re-used as DTO's, ViewModels, etc).

Most of them also add features as DRY extension methods over the underlying
ADO.NET System.Data.* interfaces, so there's no magic behaviour or heavy
abstractions happening underneath, letting you add new features orthogonally
(by adding your own DRY Extension methods in your own project), and you always
have direct access to ADO.NET IDbConnection so you're never restricted when
you need it.

~~~
Smudge
Not sure which version of EF those benchmarks are using, or how representative
it is. For what it's worth, the EF team has been focusing on performance for
EF5 and is making some promising improvements:

[http://blogs.msdn.com/b/adonet/archive/2012/02/14/sneak-
prev...](http://blogs.msdn.com/b/adonet/archive/2012/02/14/sneak-preview-
entity-framework-5-0-performance-improvements.aspx)

(Disclosure: I work at Microsoft)

~~~
mythz
The benchmarks are from StackOverflow's Open sourced Dapper ORM project - the
source of which is contained in their repo: <http://code.google.com/p/dapper-
dot-net/>

------
klausjensen
This is so awesome.

Partly as a developer who enjoys open source software, but also in part
because decisions like this makes life much easier, when you suggest using
open source in some a large corporations, where they have a very conservative
approach to open source.

~~~
NDizzle
Yeah, what I really like is that MS just open sourced a thing that is used in
places that tend to not use open source software.

Talk about getting a foot in the door.

