|
I successfully avoided using EF up until last year for some MVC stuff I'm doing.
I don't like it. I was happy with my home-spun ADO db class, although my home-spun class really does need to be bolstered with transaction handling. Even so, it's never really failed me yet. I'd also much rather handle my upserting and data retrieval via stored procs (I'm a strong advocate for putting db crap in the db).
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
John Simmons / outlaw programmer wrote: successfully avoided using EF up until last year for some MVC stuff I'm doing.
I've avoided it because it seems like it's overly engineered. Way too much code and technology for something that just wraps ADO anyhow.
If it's not broken, fix it until it is.
Everything makes sense in someone's mind.
Ya can't fix stupid.
|
|
|
|
|
Most of the time, the use of EF (or any ORM for that matter) is driven by management's desire to get something out "fast", and efficiency is NOT a consideration in those decisions. Many times, using EF is like using a hammer to kill a flea.
I'm actually torn with regards to using or not using EF. On the one hand, it doesn't require you to write BOTH ends of the database access. On the other hand, if you change the model, you have to do gyrations to update the database to match the model using the package manager console. In my case, the package manager console refuses to work because of some stupid-ass security policy override regarding powershell script execution, so I'm stuck with having to manually change the database ANYWAY. How stupid is that?!
I think I'm going to seriously explore moving over to my ADO class. My only concern is the OWIN stuff that MVC uses. There's a LOT of code that's deeply reliant on the use of EF. I wish they would change the template to allow us to select the ORM (or no-ORM code) of our choice. These frameworks are supposed to make our lives easier, but they actually don't when it comes to getting closer to the metal.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
John Simmons / outlaw programmer wrote: My only concern is the OWIN stuff that MVC uses. There's a LOT of code that's deeply reliant on the use of EF. I wish they would change the template to allow us to select the ORM (or no-ORM code) of our choice. These frameworks are supposed to make our lives easier, but they actually don't when it comes to getting closer to the metal. How can that be?
As I understand them, the MVC/MVP patterns strictly separate presentation, logic and data access. They have different takes on where to draw the separating lines, but data access is always abstracted away into the model.
How can then the 'front end' depend on the EF, unless it's actually MVC in name only?
I have lived with several Zen masters - all of them were cats.
His last invention was an evil Lasagna. It didn't kill anyone, and it actually tasted pretty good.
|
|
|
|
|
Look at the controllers. Everything generated as part of a MVC template assumes the use of EF, and the code in the controllers reflects that. You would have to re-engineer all the controller code to use ADO. Not only that, but you'd have to do it for every MVC app that you create unless you come up with your own solution template. I don't know if there are currently any ADO-based templates available on NuGet.
".45 ACP - because shooting twice is just silly" - JSOP, 2010 ----- You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010 ----- When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013
|
|
|
|
|
You're confusing Identity and possibly "scaffolding" with MVC, they are two separate things but the standard MVC template allows you to include Identity as a way of managing users if you choose to and that uses EF under the covers however you're not exposed to it. If you don't want to use Identity then don't, it's modular anyway so if you want to write an ADO provider for it you're more than welcome to do it, I don't doubt someone out there already has and you just need to download it. Same thing with scaffolding, these things are really there for prototypers and students. I've lost count of the number of "professional" web sites I've written and I've never used scaffolding once. If you don't like it, don't use it, no-one is forcing you too. You can use ado with MVC if you want, there is nothing stopping you, you might just have to do more of the coding yourself. MVC is a presentation framework, it doesn't care what you use to access the database or even if you have a database at all, use anything you want.
Your views on MVC aren't uncommon among newbies, as a default "MVC project" can indeed encompass many things (a project can include an ajax framework, jQuery, bootstrap, EF, Owin, Identity, WebApi etc) and it's common for people to think that all of these things are "MVC" and that MVC somehow needs these things but that's not true, that's just MS giving you an all-singing-all-dancing default project *if you want it*. It's up to you to recognise the technology boundaries, how they interact with each other, and what to replace if any don't float your boat. If you want pure MVC and for you to control everything then choose the empty MVC project and that's exactly what you'll get.
|
|
|
|
|
F-ES Sitecore wrote: that's just MS giving you an all-singing-all-dancing default project *if you want it*. And there is the problem, a newbie automatically uses their template to create their first project and is instantly overwhelmed by the complexity of "MVC". And at that stage they don't know enough to pick the bits they really need.
Never underestimate the power of human stupidity
RAH
|
|
|
|
|
lol if they only gave you a blank project you'd complain it's too much of a learning curve, they give you a complete project and you complain because...well...I don't really know why you are complaining. If you want to learn MVC then get a book on it, do some courses, the default projects are not there to teach you MVC but to give you a jumping point.
|
|
|
|
|
EF is just one of many things designed to keep junior developers from becoming senior developers.
And to allow PHBs to never hire senior developers.
|
|
|
|
|
I've had the odd issue but, for the most part, it works reasonably well. I can't recall the last time I used my ADO library.
Keep your friends close. Keep Kill your enemies closer.
The End
|
|
|
|
|
I've found EF to be difficult to work with especially if you want to do anything out of the box.
and it seems like everything I want to do with EF is out of the box.
Everyone has a photographic memory; some just don't have film. Steven Wright
|
|
|
|
|
I use EF for my API - it works great, probably because I don't use code first.
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
GuyThiebaut wrote: I use EF for my API
Wait.
Do you have a layer (Facade) between your API and the EF?
I'm just kidding.
No one does that.
Just wanted to scare you.
Am I funny yet? (Most people are saying no.)
|
|
|
|
|
raddevus wrote: Do you have a layer (Facade) between your API and the EF?
Oh my god! No I don't!
I am going to have to figure out how to do that - is there a nuget for it?
“That which can be asserted without evidence, can be dismissed without evidence.”
― Christopher Hitchens
|
|
|
|
|
My genetic material is further secured for the greater good of humanities future.
Grandchild->collection++;
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
Congratulations!
Another babysitting job for you then!
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Apparently, a small QC error has been detected. I've observed this problem on previous occasions and other models. This one sporadically leaks.
On such occasions, I find it best to return the unit to it's owners, or Mrs. Grandma (whichever is nearer).
Philosophical interlude and profound reflection: At present, although ejected from the womb, he gets to put his mouth on a breast whenever he desires it. How ironic that he'll expend so much effort (as an adult) trying to get his mouth on a breast so he can get back into a womb. Surely, you hear the universe's laughter!
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
KEEP THE RECEIPT!
If you lose that, you can't exchange it for one that works within the warranty period.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!
|
|
|
|
|
Probably good advice.
Normally, if something breaks as the warranty runs out (or I lost the receipt), I can just buy another, carefully repackage the broken item, and return it with the new receipt as defective.
Putting this item back into the package may well prove more difficult than most.
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
congratulations!
Grandchildren are much more fun than their parents were.
User: Technical term used by developers. See Idiot.
|
|
|
|
|
Congratulations! You better start saving for Christmas-presents for the collection
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
Mrs. Wife has two states of daytime existence:
1 - she gets called into work and earns money
2 - she doesn't get called into work and spends money shopping for baby clothes.
It's all painless from my point of view - until they get old enough to know that toys don't just come into existence when they find them . . .
Ravings en masse^ |
---|
"The difference between genius and stupidity is that genius has its limits." - Albert Einstein | "If you are searching for perfection in others, then you seek disappointment. If you are seek perfection in yourself, then you will find failure." - Balboos HaGadol Mar 2010 |
|
|
|
|
|
I read that first part in the tone of the Discovery-channel voice for documentaries and it fits perfectly
Bastard Programmer from Hell
If you can't read my code, try converting it here[^]
|
|
|
|
|
nah, just gotta learn when to play the absent-minded card.
Signature ready for installation. Please Reboot now.
|
|
|
|
|
Congratulations Grandpa!
"Go forth into the source" - Neal Morse
|
|
|
|