Tuesday 24 May 2016

AspNet Core 1.0, EntityFramework Core 1.0 DotNet Core



I am a fan of the work that Microsoft and its developers are doing with AspNet Core and EntityFramework Core. I think both frameworks were due a do-over and what they have done so far has been top quality. When I first started using EntityFramework 5 (I am a late comer to .net development) and later EntityFramework 6, I just assumed that it should have some kind of ODM (Object Document Mapping) capabilities. I was surprised it didn't, I just used EF because I thought it is great technology. When I heard that one of the new features of the new EF was new datastores, new platforms, I thought to myself "This is a dream, Microsoft actually caring about making their tech work on other platforms and other technologies?" I was looking forward to it. EF core 1.0 I like very much, when I think of the advantages it has already over EF 6, I decided to use it for my project. As I have used it I have found a lot of good stuff but I think the EF core is missing on shipping what I think are more important bits with it. Multiple DbContexts, NoSql Datastores, saving related entities and a few other features should have been in rc2. From the way I see it, bringing everything under dotnet has made things slightly strange.

I felt the same about aspnet. I used MVC 5 to create a few web apps for clients and I found it was much better than anything that I had used before from other Languages and I really enjoyed it. But using it with mono on Linux was a nightmare, with errors that might require a some serious dedicated time for debugging and all that which overtakes the essence of trying to use MVC 5 on Linux. So when I heard of then, vnext and then aspnet 5 now aspnet core, I was almost jumping for joy. Today using VSCode, to see aspnet code just work, building and testing web apps with no weird errors is just wonderful. A new era of .net development has come.

.Net Core team and maybe the Fx and all the other team members have done a miraculous job rolling out the new dotnet in such a short time. Big thumbs up, but moving your tooling back to csproj/msbuild is the wrong move to me. If I am not interested in uwp and other windows based dev projects, why would I want to have a csproj based project. Highlighted by several microsoft developers are the troubles of source control and csproj for example, so why are we going back to that again?! The project.json file in rc2 looks cluttered and noisy, something that had been done away with before rc2. The .netstandard 1.5 or .netcoreapp 1.0...ugh its all much. I like how python organizes things with their PEP-xxx standard. If I am trying to use a full .net self authored library, I have to think about conformity to netstandard 1.5, Uh-oh not to mention netcoreapp again. From my experience in the past, the .NET framework was itself a standard that we code against. Having these standards, make things hairy not difficult and anything that gets in the way of developer productivity is a turnoff. I wanted to use xunit with a project I am working on and decided to use the newest bits from the myget source used by the aspnet team and I kept getting errors about netcoreapp 1.0 something....or netstandard 1.3 something...so I decided to use Nunit which installed with no errors. Then I try to bring a reference of my web project into my test project and I get errors again about these netcore or netstandard based errors. Now maybe we don't bring in references in anymore but this just made me decide to just code and forget unit testing for now, what matters to my client is not if I unit test but that a working app should be presented when we do a review of the project next month.
.

I think the EF Core and AspNet Core  guys have done a fantastic job. But it seems accommodating dotnet has made things sort of tacky and that is what Microsoft should avoid. Don't try to be everything to everyone, be one thing to everyone. I don't know if it is because of rc2 but project.json looks cluttered and complex, I loved hand-editing project.json  easily but, for example, under frameworks, which do I use? it used to be dnx451 or dnx50, now there's dotnet56 and portable-netxx.
If I remember correctly, Einstein spoke of the virtues of simplicity driving the heart of any complex animal, what was there before seems to be better than what I see so far.

These views are personal but some of my views are shared by some folks:




You have had a good record listening to the community EF Core AspNet Core DotNet Core, so please listen to a small voice, from a small corner of this large ocean called the web.

No comments:

Post a Comment